You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: metadata stored by 0.1.8/0.1.9 copies breaks newer copies (uniqueIndexes added without a key bump) #44
The metadata keys (Symbol.for(...@1)) are shared by every copy of the package on purpose, so that tables declared through one copy can be read through another. #32 added uniqueIndexes to DatumStaticMetadata without bumping the key, so metadata stored by a copy at 0.1.8 or 0.1.9 is read by a newer copy as if it had the new shape.
Reproduction (CommonJS; old is a 0.1.9 install, current the main build):
constoldCopy=require("<0.1.9 install>/node_modules/@antelopejs/interface-database-decorators");constnewCopy=require("@antelopejs/interface-database-decorators");classRowextendsoldCopy.Table{}oldCopy.Index()(Row.prototype,"email");constmeta=newCopy.getMetadata(Row,newCopy.DatumStaticMetadata);console.log("instanceof new class:",metainstanceofnewCopy.DatumStaticMetadata);console.log("uniqueIndexes:",meta.uniqueIndexes);meta.uniqueIndexes.has("email");
Output:
instanceof new class: false
uniqueIndexes: undefined
TypeError: Cannot read properties of undefined (reading 'has')
Expected: either the key is versioned when the stored shape changes, or a reader tolerates (or upgrades) metadata stored by an older copy.
Fixed by #55 (upgrade the table metadata stored by an older copy of the package), landed on main (921bf9d, the landed campaign/integration PR #87). The key stays shared and getMetadata upgrades what it reads; src/tests/stored_metadata.test.ts covers it and the 243 module tests pass on main.
Activity
feat(database-decorators): accept any property key in the modifier me…
Upd4ting commentedon Nov 4, 2026
Fixed by #55 (upgrade the table metadata stored by an older copy of the package), landed on main (921bf9d, the landed campaign/integration PR #87). The key stays shared and getMetadata upgrades what it reads; src/tests/stored_metadata.test.ts covers it and the 243 module tests pass on main.