Fix fingerprint dedup blocking retry on empty sync result and unnecessary checkpoint diff invalidation

- Clear the dedup fingerprint when listCheckpoints returns no matching
  checkpoints, so subsequent calls with the same turn set are not
  silently skipped.
- Scope checkpoint/captured invalidation to only non-successful queries,
  avoiding O(N^2) redundant getCheckpointDiff refetches for immutable
  per-turn diffs.
This commit is contained in:
Cursor Agent committed 2026-02-19 08:02:03 +00:00
1 parent 34e30dfb78
commit 207920b40c
2 files changed
+5 -1

No files matched your search

+4 -1
View File
@@ -67,7 +67,10 @@ function EventRouter() {
void invalidateGitQueries(queryClient);
}
if (event.method === "checkpoint/captured") {
void queryClient.invalidateQueries({ queryKey: providerQueryKeys.all });
void queryClient.invalidateQueries({
queryKey: providerQueryKeys.all,
predicate: (query) => query.state.status !== "success",
});
}
dispatch({
type: "APPLY_EVENT",
+1
View File
@@ -1463,6 +1463,7 @@ export default function ChatView() {
.map((checkpoint) => [checkpoint.id, checkpoint.turnCount] as const),
);
if (Object.keys(checkpointTurnCountByTurnId).length === 0) {
checkpointTurnCountSyncFingerprintRef.current.delete(syncKey);
return;
}
dispatch({