@exodus/atoms 10.3.1 → 10.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.3.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@10.3.2...@exodus/atoms@10.3.3) (2026-04-06)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix(atoms): reset countdownLock and values on full unsubscribe in combine (#15858)
11
+
12
+ ## [10.3.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@10.3.1...@exodus/atoms@10.3.2) (2026-04-06)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fix(countdown-lock): deduplicate keys to prevent hangs on duplicate ids (#15839)
17
+
6
18
  ## [10.3.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@10.3.0...@exodus/atoms@10.3.1) (2026-04-04)
7
19
 
8
20
  ### Bug Fixes
@@ -7,14 +7,15 @@ const createCountdownLock = (keys) => {
7
7
  throw new TypeError(`lock keys must be all strings. Invalid ${key}`);
8
8
  }
9
9
  }
10
+ const uniqueKeys = new Set(keys);
10
11
  const deferred = pDefer();
11
- const unlockedKeys = [];
12
+ const unlockedKeys = new Set();
12
13
  return {
13
14
  promise: deferred.promise,
14
15
  unlock: (key) => {
15
- if (keys.includes(key) && !unlockedKeys.includes(key))
16
- unlockedKeys.push(key);
17
- if (unlockedKeys.length === keys.length) {
16
+ if (uniqueKeys.has(key))
17
+ unlockedKeys.add(key);
18
+ if (unlockedKeys.size === uniqueKeys.size) {
18
19
  deferred.resolve();
19
20
  return true;
20
21
  }
@@ -3,7 +3,8 @@ import createSimpleObserver from '../simple-observer.js';
3
3
  import enforceObservableRules from '../enforce-rules.js';
4
4
  const combine = (atoms) => {
5
5
  const { notify, observe: observeSimpleObserver } = createSimpleObserver();
6
- const countdownLock = createCountdownLock(Object.keys(atoms));
6
+ const atomKeys = Object.keys(atoms);
7
+ let countdownLock = createCountdownLock(atomKeys);
7
8
  let values = {};
8
9
  let subscriptions = [];
9
10
  let subscribers = 0;
@@ -13,6 +14,8 @@ const combine = (atoms) => {
13
14
  return;
14
15
  subscriptions.forEach((unsubscribe) => unsubscribe());
15
16
  subscriptions = [];
17
+ values = {};
18
+ countdownLock = createCountdownLock(atomKeys);
16
19
  };
17
20
  const observe = (callback) => {
18
21
  subscribers += 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/atoms",
3
- "version": "10.3.1",
3
+ "version": "10.3.3",
4
4
  "description": "Abstraction for encapsulating a piece of data behind a simple unified interface: get, set, observe",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "provenance": false
58
58
  },
59
- "gitHead": "b20b2bab316125c2d54fde410c2380d960fc1ab7"
59
+ "gitHead": "5092d1446e4e39ef43228beb0333d61b9789e18e"
60
60
  }