fix(ui): stop deleted archived tasks from reappearing in sidebar#3144
fix(ui): stop deleted archived tasks from reappearing in sidebar#3144igennova wants to merge 2 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
pauldambra
left a comment
There was a problem hiding this comment.
QA Swarm review complete. See inline comments.
| @@ -34,16 +34,12 @@ export function useUnarchiveTask(): UseUnarchiveTask { | |||
|
|
|||
| const invalidateArchiveQueries = useCallback(async () => { | |||
There was a problem hiding this comment.
Note
🤖 Automated comment by QA Swarm — not written by a human
[convergent: qa-team + paul + xp] 🟢 LOW
invalidateArchiveQueries now also invalidates WORKSPACE_QUERY_KEY and refetches ["tasks"], not just archive queries — the name undersells its scope. A future reader deciding whether to reuse or extend it will assume it's archive-only. Consider a name like invalidateAfterArchiveMutation or invalidateTaskListCaches. Not blocking.
|
|
||
| const invalidateArchiveQueries = useCallback(async () => { | ||
| await Promise.all([ | ||
| queryClient.invalidateQueries({ queryKey: WORKSPACE_QUERY_KEY }), |
There was a problem hiding this comment.
Note
🤖 Automated comment by QA Swarm — not written by a human
[convergent: qa-team/reliability + paul] 🟡 MEDIUM
The bug this PR fixes existed because the restore and delete paths' invalidation sets silently drifted apart (delete never invalidated WORKSPACE_QUERY_KEY, so the sidebar kept showing deleted archived tasks). Nothing added here prevents that drift from recurring. Worth a small regression test asserting the delete/remove outcome invalidates WORKSPACE_QUERY_KEY — workspaceQueryKey.test.ts and useWorkspaceMutations.test.tsx already show the pattern (real QueryClient + tRPC options proxy, assert partial-key match / invalidation spy).
| @@ -78,7 +74,7 @@ export function useUnarchiveTask(): UseUnarchiveTask { | |||
| hasTask, | |||
| ); | |||
| if (outcome.kind === "restore" && outcome.outcome.kind === "restored") { | |||
There was a problem hiding this comment.
Note
🤖 Automated comment by QA Swarm — not written by a human
[qa-team/generalist] ⚪ NIT
Both branches of this outcome check now call the identical invalidateArchiveQueries; the if/else if could collapse into a single predicate ((restore && restored) || (delete && deleted)). Fine to keep as-is if you prefer the explicit outcome-kind documentation.
|
Note 🤖 Automated comment by QA Swarm — not written by a human Multi-perspective review: qa-team (specialists + generalists), paul-reviewer, xp-reviewer, security-audit Verdict: 💬 APPROVE WITH NITS (round 1 @ 6291f0a)The fix is correct and well-targeted: the delete path never invalidated the sidebar's workspace query, so deleted archived tasks kept reappearing. Folding that invalidation into the shared Key findings
Convergence
Reviewer summaries
Automated by QA Swarm — not a human review |
Summary
Fixes #3143
Problem
Deleting a task from the Archived tasks view removes its local
archivesandworkspacesrows, but the UI only refreshed archive and tasks caches. Sidebar visibility depends on botharchivedTaskIdsandworkspaces, so after delete the app briefly had:That made the task reappear in the sidebar until workspaces refetched for another reason.
Restore already invalidated workspaces via
invalidateOnRestore; delete used a separate helper that did not.Solution
Include
WORKSPACE_QUERY_KEYinvalidation ininvalidateArchiveQueries, which runs after archived-task delete (and is shared with restore).Video
Screen.Recording.2026-07-04.at.12.23.57.PM.mov