Skip to content

Commit d74f219

Browse files
authored
Merge pull request #22 from jwyce/changeset-release/main
2 parents f8f09bd + 81efe9e commit d74f219

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

.changeset/tasty-mangos-sneeze.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# gungi.js
22

3+
## 3.2.1
4+
5+
### Patch Changes
6+
7+
- f8f09bd: 🔧 prevent duplicate piece IDs in state transitions
8+
9+
Addresses race conditions in rapid `load()` calls where same piece
10+
type/color could receive identical IDs, breaking game state integrity.
11+
12+
- `applyCanonicalToMissingIds` used flawed conflict detection
13+
- Arata moves assigned same ID to both board and hand pieces
14+
- Race conditions during rapid state transitions
15+
16+
Fixed core ID assignment logic with `Set`-based conflict tracking
17+
rather than real-time array scanning. Balanced two requirements:
18+
19+
**Stability**: Preserve IDs across close FEN states (critical for UX)
20+
**Uniqueness**: Ensure no duplicate IDs ever persist in system
21+
22+
- `ensureUniqueIdsLenient()`: Minimal fixes, preserves stability
23+
- `ensureUniqueIds()`: Complete reassignment for canonical states
24+
- `checkForDuplicateIds()`: Detection without modification
25+
26+
Arata moves now maintain hand piece ID stability while giving
27+
board pieces new IDs, eliminating the duplicate scenario without
28+
breaking expected behavior.
29+
330
## 3.2.0
431

532
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gungi.js",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"type": "module",
55
"description": "library which contains all the necessary logic for the strategy game from the HUNTER×HUNTER manga",
66
"main": "lib/gungi.js",

0 commit comments

Comments
 (0)