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
Follow-up from the autonumber generation fix in objectql (engine applyAutonumbers). Today, empty autonumber fields are generated before required-validation as max(existing)+1, seeded per object.field and incremented in memory.
Gap
The in-memory counter is correct for a single instance (re-seeds from max on restart; monotonic in-process), but two instances can collide.
The seed currently loads up to 5000 rows to compute max.
Proposal
Back autonumber with a persistent, atomically-incremented sequence at the driver layer (e.g. a sys_sequence row with UPDATE ... RETURNING value+1, or native DB sequences), so values are correct across instances. Replace the row-scan seed with a max() aggregate as an interim improvement.
Notes
Touches packages/objectql/src/engine.ts + drivers — hot files; dedicated, reviewed change.
Activity
docs(adr): ADR-0034 robust multi-write transactions (ambient transact…
fix(autonumber): single owner = persistent driver sequence (#1603) (#…
test(driver-sql): autonumber sequence survives a driver restart (#1603)…
feat(autonumber): date, {field} & per-scope counter reset for autonum…
feat(spec): declare `{0000}` as the contract default for format-less …
docs(adr): delete the six stale line pointers left outside the object…
test(spec): the first data/ file group's test titles state each cited…