https://github.com/GautamTalksDev/keyring/pull/new/fix/stale-scan-refresh - #5
https://github.com/GautamTalksDev/keyring/pull/new/fix/stale-scan-refresh#5GautamTalksDev wants to merge 2 commits into
Conversation
Abort prior card requests and require responses to match the active scan so old cards and terminal status cannot overwrite a new scan or its headline. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Summary by QodoPrevent stale card refreshes from overwriting active scans
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
Use a monotonic scan-start token to prevent late start responses from replacing the active scan or installing stale SSE subscriptions, keeping queue updates tied to the latest invocation. Co-authored-by: Cursor <cursoragent@cursor.com>
Addresses Qodo finding on #4. A card refresh from a previous scan could resolve
after a new scan began, overwriting the cleared queue and restoring "completed"
status — producing a headline with mismatched grant and system counts during a
running scan. In-flight fetches are now aborted on new scans and responses are
discarded when scanId no longer matches. Regression test added.