Skip to content

Fix stale version status when switching versions until cache catches up #129

@jspada200

Description

@jspada200

Summary

After changing a version’s status, switching away and back can briefly show the old status; the React Query cache should update optimistically so the UI reflects the latest status immediately.

Image

Details

We use React Query for client-side caching of version-related data. After a successful status mutation, cached queries for the affected version (or list keys that include it) should be updated optimistically so navigation between versions does not flash stale data.

Steps to reproduce

  1. Change a version’s status in the UI.
  2. Switch to a different version.
  3. Switch back to the version whose status was changed.

Expected vs actual

  • Expected: Status immediately reflects the value the user set.
  • Actual: Old status may still appear until the cache/backend eventually updates.

Likely area: status mutation handlers, queryClient.setQueryData / optimistic updates, and query keys for version metadata.

Acceptance criteria

  • After a successful status change, navigating between versions never shows a reverted/stale status for that version
  • Optimistic update rolls back or surfaces an error if the mutation fails
  • All changes tested locally
  • All relevant automated tests complete successfully
  • Verified no existing workflows broken
  • For UI changes, screenshots or gif animations of the changes included
  • Steps to test included in PR

Suggested labels

bug, Frontend

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrontendFrontend WorkbugSomething isn't working

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions