msgpackr 2.0.1 → 2.0.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/dist/index-no-eval.cjs +8 -1
- package/dist/index-no-eval.cjs.map +1 -1
- package/dist/index-no-eval.min.js +1 -1
- package/dist/index-no-eval.min.js.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/node.cjs +8 -1
- package/dist/node.cjs.map +1 -1
- package/dist/test.js +32 -1
- package/dist/test.js.map +1 -1
- package/pack.js +8 -1
- package/package.json +2 -2
package/dist/node.cjs
CHANGED
|
@@ -1415,7 +1415,14 @@ class Packr extends Unpackr {
|
|
|
1415
1415
|
let newSharedData = (packr._prepareStructures || prepareStructures)(structures, packr);
|
|
1416
1416
|
if (!encodingError) { // TODO: If there is an encoding error, should make the structures as uninitialized so they get rebuilt next time
|
|
1417
1417
|
if (packr.saveStructures(newSharedData, newSharedData.isCompatible) === false) {
|
|
1418
|
-
//
|
|
1418
|
+
// The save was declined (a concurrent writer updated the shared structures,
|
|
1419
|
+
// or the store transaction did not durably commit). Our in-memory
|
|
1420
|
+
// structures + transition trie may now reference record ids that were
|
|
1421
|
+
// never persisted; re-packing as-is would re-emit the same record pointing
|
|
1422
|
+
// at an unpersisted structure (-> "Record id is not defined" on decode).
|
|
1423
|
+
// Mark structures uninitialized so the re-pack reloads durable structures
|
|
1424
|
+
// via getStructures, rebuilds the transition trie, and re-mints + re-saves.
|
|
1425
|
+
structures.uninitialized = true;
|
|
1419
1426
|
return packr.pack(value, encodeOptions);
|
|
1420
1427
|
}
|
|
1421
1428
|
packr.lastNamedStructuresLength = sharedLength;
|