Skip to content

queryAll on slug-history sheet returns empty after staff-approve merge #47

@themightychris

Description

@themightychris

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions