@exodus/atoms 10.2.0 → 10.2.1
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,14 @@
|
|
|
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.2.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@10.2.0...@exodus/atoms@10.2.1) (2026-04-02)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix(atoms): sequenced-keystore get() idempotency when isSoleWriter is true (#15787)
|
|
11
|
+
|
|
12
|
+
- fix(atoms): validate key membership in countdown-lock unlock (#15789)
|
|
13
|
+
|
|
6
14
|
## [10.2.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@10.1.0...@exodus/atoms@10.2.0) (2026-03-23)
|
|
7
15
|
|
|
8
16
|
### Features
|
package/lib/countdown-lock.js
CHANGED
|
@@ -12,7 +12,7 @@ const createCountdownLock = (keys) => {
|
|
|
12
12
|
return {
|
|
13
13
|
promise: deferred.promise,
|
|
14
14
|
unlock: (key) => {
|
|
15
|
-
if (!unlockedKeys.includes(key))
|
|
15
|
+
if (keys.includes(key) && !unlockedKeys.includes(key))
|
|
16
16
|
unlockedKeys.push(key);
|
|
17
17
|
if (unlockedKeys.length === keys.length) {
|
|
18
18
|
deferred.resolve();
|
|
@@ -10,6 +10,7 @@ const createSequencedKeystoreAtom = ({ keystore, config: { key, separator = '.',
|
|
|
10
10
|
enable: isSoleWriter,
|
|
11
11
|
});
|
|
12
12
|
let cache;
|
|
13
|
+
let isCachePopulated = false;
|
|
13
14
|
const getKey = (index) => key.endsWith(separator) ? `${key}${index}` : `${key}${separator}${index}`;
|
|
14
15
|
const getByIndex = async (index) => {
|
|
15
16
|
const key = getKey(index);
|
|
@@ -48,18 +49,20 @@ const createSequencedKeystoreAtom = ({ keystore, config: { key, separator = '.',
|
|
|
48
49
|
}
|
|
49
50
|
if (isSoleWriter) {
|
|
50
51
|
cache = value;
|
|
52
|
+
isCachePopulated = true;
|
|
51
53
|
await notify(value);
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
const get = async () => {
|
|
55
|
-
if (
|
|
57
|
+
if (isCachePopulated)
|
|
56
58
|
return cache;
|
|
57
59
|
const items = await list();
|
|
58
|
-
const value = items.map((item) => item.value);
|
|
60
|
+
const value = items.length === 0 ? undefined : items.map((item) => item.value);
|
|
59
61
|
if (isSoleWriter) {
|
|
60
62
|
cache = value;
|
|
63
|
+
isCachePopulated = true;
|
|
61
64
|
}
|
|
62
|
-
return
|
|
65
|
+
return value;
|
|
63
66
|
};
|
|
64
67
|
return enforceObservableRules({
|
|
65
68
|
get,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/atoms",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.1",
|
|
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": "
|
|
59
|
+
"gitHead": "84a143db0454dbf902aaad435fe5d5f1adedb260"
|
|
60
60
|
}
|