From e68cd85971662fb1b2eb7eb3fc8f65289068dc55 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Sat, 2 May 2026 12:59:45 -0600 Subject: [PATCH 1/5] feat: upgrade msgpackr to v2 and use structon for random-access struct encoding msgpackr v1's randomAccessStructure option was removed in v2. This adopts the structon package (the intended replacement) which provides the same capability as a mixin via createStructon(Encoder). RecordEncoder now extends the structon- enhanced encoder class instead of plain Encoder, and the removed randomAccessStructure option is dropped from OpenDBIObject. Co-Authored-By: Claude Sonnet 4.6 --- package-lock.json | 189 +++++++++++++--------------------- package.json | 3 +- resources/RecordEncoder.ts | 5 +- utility/lmdb/OpenDBIObject.js | 1 - 4 files changed, 80 insertions(+), 118 deletions(-) diff --git a/package-lock.json b/package-lock.json index 23080e9ad..4895ef20f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "minimist": "1.2.8", "moment": "2.30.1", "mqtt-packet": "~9.0.1", - "msgpackr": "1.11.9", + "msgpackr": "^2.0.1", "needle": "3.5.0", "node-forge": "^1.3.1", "node-stream-zip": "1.15.0", @@ -82,6 +82,7 @@ "ses": "^1.15.0", "stream-chain": "2.2.5", "stream-json": "1.9.1", + "structon": "file:../../structon", "systeminformation": "^5.31.4", "tar-fs": "^3.1.2", "ulidx": "0.5.0", @@ -137,6 +138,25 @@ "utf-8-validate": "^5.0.10" } }, + "../../structon": { + "version": "1.0.0", + "license": "Apache-2.0", + "devDependencies": { + "cbor-x": "^1.6.4", + "mocha": "^10.0.0", + "msgpackr": "^2.0.0", + "msgpackr-legacy": "npm:msgpackr@1.11.10", + "rollup": "^4.60.2" + }, + "peerDependencies": { + "msgpackr": ">=2.0.1" + }, + "peerDependenciesMeta": { + "msgpackr": { + "optional": true + } + } + }, "node_modules/@agoric/babel-generator": { "version": "7.17.6", "license": "MIT", @@ -345,6 +365,7 @@ "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.1024.0.tgz", "integrity": "sha512-8qdO5aLCzaf9l0RdrSBW1iIroRKP2QBqtZ6lkrtHKiaaH0B18xEn+lrEgiN/eCf3uRAYk4cqbnI2XcWzm+7dDQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@aws-crypto/sha1-browser": "5.2.0", "@aws-crypto/sha256-browser": "5.2.0", @@ -2289,6 +2310,7 @@ "version": "8.44.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.44.0", "@typescript-eslint/types": "8.44.0", @@ -3001,6 +3023,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3014,6 +3037,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3027,6 +3051,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3040,6 +3065,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3053,6 +3079,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3066,6 +3093,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3534,7 +3562,6 @@ "integrity": "sha512-GW2yqqOTzdz3K6z0XpPO1EjLzOw0kclmAcLeW6cBt0DYM7ZNLRKanpzXxaSXkePpo4ZYMWhddE4WpSWG8e/QaQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@smithy/types": "^4.14.1", "tslib": "^2.6.2" @@ -4566,6 +4593,7 @@ "node_modules/@types/node": { "version": "25.4.0", "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.18.0" } @@ -4654,6 +4682,7 @@ "integrity": "sha512-rLoGZIf9afaRBYsPUMtvkDWykwXwUPL60HebR4JgTI8mxfFe2cQTu3AGitANp4b9B2QlVru6WzjgB2IzJKiCSA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.58.0", "@typescript-eslint/types": "8.58.0", @@ -4857,6 +4886,7 @@ "version": "8.16.0", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -5019,7 +5049,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5031,7 +5060,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5335,32 +5363,6 @@ "version": "1.1.2", "license": "MIT" }, - "node_modules/bufferutil": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz", - "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/bufferutil/node_modules/node-gyp-build": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", - "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", - "license": "MIT", - "optional": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "node_modules/bytestreamjs": { "version": "2.0.1", "license": "BSD-3-Clause", @@ -5463,6 +5465,7 @@ "version": "6.2.2", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -5600,7 +5603,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "is-regexp": "^1.0.0", "is-supported-regexp-flag": "^1.0.0" @@ -6131,6 +6133,7 @@ "version": "9.39.4", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -6189,6 +6192,7 @@ "version": "10.1.8", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -6411,7 +6415,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "clone-regexp": "^1.0.0" }, @@ -7103,6 +7106,7 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.13.2.tgz", "integrity": "sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig==", "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -7168,7 +7172,6 @@ "integrity": "sha512-RRXMLbbdymiZsHOeg5b+DShzsMvVvkgsG9690BBCc7tzIpDb0CT7EgWEQo+rwCICr35EwZoLjtfwF6mMiCOenA==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@aws-sdk/client-s3": "^3.1012.0", "@aws-sdk/lib-storage": "3.964.0", @@ -7271,7 +7274,6 @@ "integrity": "sha512-ro6B04Q5TjPgIKdSWGJ+tj2ordVF1IfZJERwGpYkrwhboNEoXBXuzpfnh2LYBPvMmFJQ+8UXSFw1jkLLgxM+ig==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@smithy/abort-controller": "^4.2.7", "@smithy/middleware-endpoint": "^4.4.1", @@ -7294,7 +7296,6 @@ "integrity": "sha512-gipd/g0USN8ncvRMdoaru8PxYNUSEJp//+XbLf+3VNDQ6gcSsTcYqyNa3f+oEKIyV0clpOkxzautkN7hVPsn/g==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@harperfast/extended-iterable": "1.0.3", "msgpackr": "1.11.9", @@ -7327,7 +7328,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=18" } @@ -7345,7 +7345,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=18" } @@ -7363,7 +7362,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7381,7 +7379,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7399,7 +7396,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7417,7 +7413,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7435,7 +7430,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">=18" } @@ -7453,7 +7447,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">=18" } @@ -7470,8 +7463,7 @@ "optional": true, "os": [ "darwin" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-darwin-x64": { "version": "3.5.3", @@ -7485,8 +7477,7 @@ "optional": true, "os": [ "darwin" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-linux-arm": { "version": "3.5.3", @@ -7500,8 +7491,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-linux-arm64": { "version": "3.5.3", @@ -7515,8 +7505,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-linux-x64": { "version": "3.5.3", @@ -7530,8 +7519,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-win32-arm64": { "version": "3.5.3", @@ -7545,8 +7533,7 @@ "optional": true, "os": [ "win32" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-win32-x64": { "version": "3.5.3", @@ -7560,8 +7547,7 @@ "optional": true, "os": [ "win32" - ], - "peer": true + ] }, "node_modules/harper/node_modules/fs-extra": { "version": "11.3.3", @@ -7569,7 +7555,6 @@ "integrity": "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -7585,7 +7570,6 @@ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -7600,7 +7584,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "@harperfast/extended-iterable": "^1.0.3", "msgpackr": "^1.11.2", @@ -7622,13 +7605,22 @@ "@lmdb/lmdb-win32-x64": "3.5.3" } }, + "node_modules/harper/node_modules/msgpackr": { + "version": "1.11.9", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.9.tgz", + "integrity": "sha512-FkoAAyyA6HM8wL882EcEyFZ9s7hVADSwG9xrVx3dxxNQAtgADTrJoEWivID82Iv1zWDsv/OtbrrcZAzGzOMdNw==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "msgpackr-extract": "^3.0.2" + } + }, "node_modules/harper/node_modules/needle": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz", "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "iconv-lite": "^0.6.3", "sax": "^1.2.4" @@ -7645,8 +7637,7 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/harper/node_modules/node-gyp-build-optional-packages": { "version": "5.2.2", @@ -7654,7 +7645,6 @@ "integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "detect-libc": "^2.0.1" }, @@ -7670,7 +7660,6 @@ "integrity": "sha512-UUmvQ/7KTZt/vHjhRrnyS7h+J7qPBQnpG80V56xmIC+o9IqYmQOw/UIny9S9zYDfRBR0ClouCr464EkBMIT7Fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", @@ -7694,7 +7683,6 @@ "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "readable-stream": "^4.0.0", "split2": "^4.0.0" @@ -7706,7 +7694,6 @@ "integrity": "sha512-WX0la7n7CbnguuaIQoT4Fc0IJckPDOUldzOwlZ0nwpOcySS+Six/tXBdc0RX17J5o1To0SAr3xDJjDLsOfDFQA==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@noble/hashes": "^1.4.0", "asn1js": "^3.0.5", @@ -7724,8 +7711,7 @@ "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.2.tgz", "integrity": "sha512-n9wh8tvBe5sFmsqlg+XQhaQLumwpqoAUruLwjCopgTmUBjJ/fjtBsJzKleCaIGBOMXYEhp1YfKl4d7rJ5ZKJGA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/harper/node_modules/readable-stream": { "version": "4.7.0", @@ -7733,7 +7719,6 @@ "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -7765,7 +7750,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -7777,7 +7761,6 @@ "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true, "license": "ISC", - "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -7791,7 +7774,6 @@ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true, "license": "ISC", - "peer": true, "engines": { "node": ">= 10.x" } @@ -7802,7 +7784,6 @@ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -7813,7 +7794,6 @@ "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -7836,7 +7816,6 @@ "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", "dev": true, "license": "ISC", - "peer": true, "bin": { "yaml": "bin.mjs" }, @@ -7904,7 +7883,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "parse-columns": "git+https://github.com/int0h/parse-columns.git" } @@ -8222,7 +8200,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" }, @@ -8310,7 +8287,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -8322,7 +8298,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -8607,6 +8582,15 @@ "@lmdb/lmdb-win32-x64": "3.5.4" } }, + "node_modules/lmdb/node_modules/msgpackr": { + "version": "1.11.12", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.12.tgz", + "integrity": "sha512-RBdJ1Un7yGlXWajrkxcSa93nvQ0w4zBf60c0yYv7YtBelP8H2FA7XsfBbMHtXKXUMUxH7zV3Zuozh+kUQWhHvg==", + "license": "MIT", + "optionalDependencies": { + "msgpackr-extract": "^3.0.2" + } + }, "node_modules/lmdb/node_modules/node-addon-api": { "version": "6.1.0", "license": "MIT" @@ -9143,9 +9127,9 @@ "license": "MIT" }, "node_modules/msgpackr": { - "version": "1.11.9", - "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.9.tgz", - "integrity": "sha512-FkoAAyyA6HM8wL882EcEyFZ9s7hVADSwG9xrVx3dxxNQAtgADTrJoEWivID82Iv1zWDsv/OtbrrcZAzGzOMdNw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-2.0.1.tgz", + "integrity": "sha512-9J+tqTEsbHqY8YohazYgty7LgerFIWxvMLpUjqETSmjHojtJm2WnX2kK/2a1fLI7CO7ERP1YSEUXMucz4j+yBA==", "license": "MIT", "optionalDependencies": { "msgpackr-extract": "^3.0.2" @@ -9435,7 +9419,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "number-is-nan": "^1.0.0" }, @@ -9459,7 +9442,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9805,7 +9787,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "escape-string-regexp": "^1.0.3", "execall": "^1.0.0", @@ -9823,7 +9804,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.8.0" } @@ -10141,6 +10121,7 @@ "integrity": "sha512-8c3mgTe0ASwWAJK+78dpviD+A8EqhndQPUBpNUIPt6+xWlIigCwfN01lWr9MAede4uqXGTEKeQWTvzb3vjia0Q==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -10410,7 +10391,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "is-finite": "^1.0.0" }, @@ -10894,7 +10874,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "array-uniq": "^1.0.2", "arrify": "^1.0.0", @@ -11077,6 +11056,10 @@ ], "license": "MIT" }, + "node_modules/structon": { + "resolved": "../../structon", + "link": true + }, "node_modules/superagent": { "version": "10.3.0", "dev": true, @@ -11272,6 +11255,7 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -11387,6 +11371,7 @@ "version": "5.9.3", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11455,32 +11440,6 @@ "punycode": "^2.1.0" } }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/utf-8-validate/node_modules/node-gyp-build": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", - "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", - "license": "MIT", - "optional": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "license": "MIT" diff --git a/package.json b/package.json index 95b6aa4fd..7217d52b8 100644 --- a/package.json +++ b/package.json @@ -207,7 +207,8 @@ "minimist": "1.2.8", "moment": "2.30.1", "mqtt-packet": "~9.0.1", - "msgpackr": "1.11.9", + "msgpackr": "^2.0.1", + "structon": "file:../../structon", "needle": "3.5.0", "node-forge": "^1.3.1", "node-stream-zip": "1.15.0", diff --git a/resources/RecordEncoder.ts b/resources/RecordEncoder.ts index 8bea2e9e9..7ab06f9e3 100644 --- a/resources/RecordEncoder.ts +++ b/resources/RecordEncoder.ts @@ -6,6 +6,7 @@ */ import { Encoder } from 'msgpackr'; +import { createStructon } from 'structon'; import { HAS_PREVIOUS_RESIDENCY_ID, HAS_CURRENT_RESIDENCY_ID, @@ -22,6 +23,8 @@ import { getThisNodeId } from './nodeIdMapping.ts'; import { recordAction } from './analytics/write.ts'; import { RocksDatabase } from '@harperfast/rocksdb-js'; import { when } from '../utility/when.ts'; + +const StructonEncoder = createStructon(Encoder) as typeof Encoder; export type Entry = { key: any; value: any; @@ -73,7 +76,7 @@ let timestampNextEncoding = 0, additionalAuditRefsNextEncoding: Array<{ version: number; nodeId: number }> | undefined; // tracking metadata with a singleton works better than trying to alter response of getEntry/get and coordinating that across caching layers export let lastMetadata: Entry | null = null; -export class RecordEncoder extends Encoder { +export class RecordEncoder extends StructonEncoder { structureUpdate?: any; isRocksDB: boolean; name: string; diff --git a/utility/lmdb/OpenDBIObject.js b/utility/lmdb/OpenDBIObject.js index a2a888f5c..697e26df7 100644 --- a/utility/lmdb/OpenDBIObject.js +++ b/utility/lmdb/OpenDBIObject.js @@ -21,7 +21,6 @@ class OpenDBIObject { this.sharedStructuresKey = Symbol.for('structures'); if (isPrimary) { this.cache = LMDB_CACHING && { validated: true }; - this.randomAccessStructure = true; this.freezeData = true; this.encoder = { Encoder: RecordEncoder }; } From be98832ab1030a50617aab32921c6a130d781eb7 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Sat, 2 May 2026 15:23:46 -0600 Subject: [PATCH 2/5] Update structon --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7217d52b8..677570902 100644 --- a/package.json +++ b/package.json @@ -208,7 +208,7 @@ "moment": "2.30.1", "mqtt-packet": "~9.0.1", "msgpackr": "^2.0.1", - "structon": "file:../../structon", + "structon": "^1.0.1", "needle": "3.5.0", "node-forge": "^1.3.1", "node-stream-zip": "1.15.0", From 7380b3c38c6104bac318a9b2b604db64513ed501 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Sat, 2 May 2026 22:28:11 -0600 Subject: [PATCH 3/5] Update structon --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 677570902..6b7b0987c 100644 --- a/package.json +++ b/package.json @@ -208,7 +208,7 @@ "moment": "2.30.1", "mqtt-packet": "~9.0.1", "msgpackr": "^2.0.1", - "structon": "^1.0.1", + "structon": "^1.0.2", "needle": "3.5.0", "node-forge": "^1.3.1", "node-stream-zip": "1.15.0", From ae5278486e870c5cfa798eec4436a31b0ffe60d2 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Sun, 3 May 2026 21:34:14 -0600 Subject: [PATCH 4/5] Update structon --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6b7b0987c..1fb22a8e2 100644 --- a/package.json +++ b/package.json @@ -208,7 +208,7 @@ "moment": "2.30.1", "mqtt-packet": "~9.0.1", "msgpackr": "^2.0.1", - "structon": "^1.0.2", + "structon": "^1.0.3", "needle": "3.5.0", "node-forge": "^1.3.1", "node-stream-zip": "1.15.0", From a5129cf31ecac7d5801c4f3d0a3272abec7a2a4a Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Sun, 24 May 2026 01:26:34 -0600 Subject: [PATCH 5/5] fix: enable RecordEncoder for all DBIs, not just primary Non-primary DBIs like the HNSW indexStore also need structon typed-struct support. Previously msgpackr v1 set `randomAccessStructure = true` unconditionally; move the encoder assignment outside the isPrimary guard to restore that behavior for all DBIs. Co-Authored-By: Claude Sonnet 4.6 --- utility/lmdb/OpenDBIObject.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility/lmdb/OpenDBIObject.ts b/utility/lmdb/OpenDBIObject.ts index 6a92ea488..ab2f44046 100644 --- a/utility/lmdb/OpenDBIObject.ts +++ b/utility/lmdb/OpenDBIObject.ts @@ -34,10 +34,10 @@ export class OpenDBIObject { this.sharedStructuresKey = Symbol.for('structures'); /** @type {any} */ this.compression = undefined; + this.encoder = { Encoder: RecordEncoder }; if (isPrimary) { this.cache = LMDB_CACHING && { validated: true }; this.freezeData = true; - this.encoder = { Encoder: RecordEncoder }; } } }