Skip to content

Late comment reads can erase newer comment mutations from the shared cache #3303

Description

@Chris0Jeky

Summary

cardCommentStore.fetchCardComments commits every response directly into cardCommentsByCardId, while create/update/delete mutate the same cache independently. The modal's generation token protects only its local loading/error state; it does not prevent the store from committing a stale payload.

Confirmed races

  1. A comment fetch begins.
  2. A create, update, or delete succeeds and updates the shared cache.
  3. The older fetch resolves with its pre-mutation snapshot and replaces the cache, erasing the confirmed mutation from the UI.

Two overlapping fetches can also resolve out of order, and a request that outlives board navigation can repopulate the cache for the board that is no longer selected.

Expected contract

  • Only the latest read for a card may commit.
  • A read that began before a successful local comment mutation may return its payload to its caller, but must not overwrite the post-mutation cache.
  • Late requests must not repopulate a different selected board's comment cache.
  • Create remains idempotent by stable comment id when an authoritative refresh committed the same comment first.
  • Existing API return values, sorting, toast/error/loading behavior, and demo-mode behavior remain unchanged.

Acceptance

  • Focused regressions for stale fetch after create/update/delete.
  • Regression for out-of-order reads.
  • Regression for navigation while a read is in flight.
  • Regression for refresh-before-create stable-id deduplication.
  • Targeted frontend tests, typecheck/build, and exact-head hosted CI pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority IIThe active direction's next tranche: wedge capabilities, significant defects, near-term hardening.bugSomething isn't workingfrontendPrimary implementation impact in Vue/TypeScript UI and client runtime.testingTest coverage, harnesses, regression prevention, and verification pipeline work.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions