Observed
In the account-claim test for post-onboarding merge approval, after store.transact commits the slug-history record (file visible via git ls-tree HEAD slug-history/person/<oldSlug>.toml), app.store.public['slug-history'].queryAll() returns [].
The same is true for query(). The test had to fall back to git show HEAD:slug-history/person/<oldSlug>.toml to verify.
Repro
Likely cause
The gitsheets sheet's in-memory tree pointer isn't updated between transactions for sheets that aren't pre-loaded into our InMemoryState (slug-history and revocations are queried on-demand only). Other sheets like people get their post-commit state via loadInMemoryState at boot and then via StateApply.upsertX in-memory, so the staleness doesn't matter for our route handlers — but it shows up the moment a test or admin script does a direct read against the gitsheets-side query API.
Impact
- Production: the existing slug-history redirect lookup in the request handler (gitsheets'
byEntityTypeAndOldSlug index) doesn't necessarily share this staleness; that should be verified.
- Tests/scripts: direct
queryAll() on slug-history (and possibly revocations) is unreliable post-transaction.
Next steps
- Reproduce in isolation against the gitsheets v1.0.x API.
- File upstream if it's a gitsheets bug, or document a refresh hook here if it's expected behavior.
Observed
In the account-claim test for post-onboarding merge approval, after
store.transactcommits the slug-history record (file visible viagit ls-tree HEAD slug-history/person/<oldSlug>.toml),app.store.public['slug-history'].queryAll()returns[].The same is true for
query(). The test had to fall back togit show HEAD:slug-history/person/<oldSlug>.tomlto verify.Repro
feat/account-claim(PR feat(account-claim): legacy-account-claim flow with email/password/staff proofs #46)apps/api/tests/account-claim.test.ts→submit + staff-approve merges fresh Person into legacyqueryAll()reliably failsLikely cause
The gitsheets sheet's in-memory tree pointer isn't updated between transactions for sheets that aren't pre-loaded into our
InMemoryState(slug-history and revocations are queried on-demand only). Other sheets likepeopleget their post-commit state vialoadInMemoryStateat boot and then viaStateApply.upsertXin-memory, so the staleness doesn't matter for our route handlers — but it shows up the moment a test or admin script does a direct read against the gitsheets-side query API.Impact
byEntityTypeAndOldSlugindex) doesn't necessarily share this staleness; that should be verified.queryAll()on slug-history (and possibly revocations) is unreliable post-transaction.Next steps