@aiam/ciba 0.8.2 → 0.8.4
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/ciba.mjs +1 -5
- package/package.json +1 -1
package/ciba.mjs
CHANGED
|
@@ -496,10 +496,7 @@ function startDaemon(provider, deviceDoc, privateKey, serverUrl) {
|
|
|
496
496
|
dlog(`cache miss; writing requests[${newRid}] attrs=${JSON.stringify(attrs)}`);
|
|
497
497
|
requests.set(newRid, { ...attrs, status: 'pending', created_at: new Date().toISOString() });
|
|
498
498
|
|
|
499
|
-
|
|
500
|
-
// the result. resources map updates survive WS reconnects because
|
|
501
|
-
// Yjs re-syncs the full doc state; token:<newRid> may be missed
|
|
502
|
-
// if the write happened during a reconnect gap.
|
|
499
|
+
dlog(`resources map: ${JSON.stringify([...resourcesMap.entries()])} requested=${requestedResource}`);
|
|
503
500
|
const prevTokenMapName = resourcesMap.get(requestedResource);
|
|
504
501
|
const newTokenMap = deviceDoc.getMap(`token:${newRid}`);
|
|
505
502
|
|
|
@@ -512,7 +509,6 @@ function startDaemon(provider, deviceDoc, privateKey, serverUrl) {
|
|
|
512
509
|
30_000
|
|
513
510
|
).then((newMapName) => {
|
|
514
511
|
const m = deviceDoc.getMap(newMapName);
|
|
515
|
-
// wait for ciphertext to land on the new map (may arrive right after resources update)
|
|
516
512
|
return firstInYMap(m, (key) => key === 'ciphertext' || key === 'error', 5_000)
|
|
517
513
|
.then(() => m).catch(() => m);
|
|
518
514
|
});
|
package/package.json
CHANGED