Repository navigation
fix(web): only restore failed deletes on partial bulk-delete failure (#22803) - #22968
Merged
Merged
Conversation
…22803) bulkDelete in useActionItems.ts awaited Promise.all over the selected ids and, on any single rejection, restored the *entire* selection in the catch block -- including tasks whose DELETE had already succeeded server-side. Those tasks reappeared as ghosts (gone on the server, listed in the UI; opening them failed) until the next reload dropped them again. Switch to Promise.allSettled and only restore the ids that actually failed. Added a regression test that isolates bulkDelete's own revert logic from the background reload a successful delete's cache invalidation triggers (so the test can't pass merely because a later refetch happens to correct the state).
kodjima33
deleted the
watchdog/issue-22803-bulk-delete-partial-failure
branch
October 21, 2026 04:12
This was referenced Oct 29, 2026
Closed
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Web Tasks: a partly failed bulk delete restores every selected task, not just the ones whose DELETE failed (#22803).
bulkDeleteinweb/app/src/hooks/useActionItems.tsoptimistically removes the selected tasks, thenawait Promise.all(ids.map((id) => deleteActionItem(id))).Promise.allrejects as soon as the first DELETE rejects, and thecatchblock unconditionally restores the entiredeletedItemsselection — including tasks whose DELETE already succeeded server-side. Those tasks reappear in the UI as ghosts: gone on the server, listed in the client, and opening one fails until the next reload drops it again.Fix
Switch to
Promise.allSettledand only restore the ids whose delete actually rejected. Tasks the server already deleted stay gone; the error still surfaces.What I tested
useActionItems.test.tsx) that deliberately keeps the background reload a successful delete's cache invalidation triggers pending (never resolves), so the assertion isolatesbulkDelete's own revert logic from a later refetch that would otherwise mask the bug. Verified it fails on the pre-fix code (['a','b','c']restored) and passes post-fix (['b']only).web/appsuite:bun run test(vitest 869/869 + moonshine smoke) — pass.bun run typecheck— clean.bunx oxlint src scripts moonshine.config.ts— no new warnings (pre-existing warnings elsewhere unrelated to this change).🤖 automated by hourly watchdog — tested and merged
Failure-Class: none