Repository navigation
Description
Bug: bulk Inbox send discards drafts and failed recipients after refusal
P2. Reproduced locally against current main f406afc4aa0d4b916d6f09ff9781400a92d7f4d0. Production was not tested.
Reproduction and observed behavior
- Select two valid email conversations, Alpha and Bravo, leaving another conversation unselected.
- Open bulk Send and type
Please review this update before Friday.. - Have both send requests reject. The summary correctly reports zero successes and two failures, including the first refusal reason.
- Despite the failures, the dialog closes and all selected recipients are cleared. Reselect a failed recipient and reopen Send: the message is empty and Send is disabled.
With one success and one refusal, the same cleanup discards failed Bravo and the draft. These are two manifestations of one recovery defect. The user has to reconstruct both the message and the failed-recipient list; selecting the original set again risks resending to successful recipients.
Expected: preserve the message and only the failed recipients, or provide equivalent durable retry context. A successful send should retain the existing close-and-clear behavior. The shared dialog guide requires preserving decision context on failure (services/ui-docs/content/components/dialog.md:31).
Root cause
services/platform/app/features/conversations/hooks/use-bulk-actions.ts reports the Promise.allSettled outcome, then unconditionally closes the bulk Send dialog and calls onComplete([]) (lines 245–246). use-inbox-list.ts interprets that empty list as clearSelection() (lines 296–299). BulkSendDialog owns its draft in component state, and its conditional parent mount discards that state on close. There is no retained failed-ID set or bulk draft.
The same hook's five status actions already retain refused selections. Send follows its own path and does not use that recovery behavior.
Local evidence and controls
An independent parent replay passed 7 Chromium tests against the real useInboxList, useConversationSelection, useBulkActions, BulkSendDialog, shared Checkbox and ConfirmDialog:
- All-success closes and clears.
- All-refusal and partial-refusal both clear selection and reopen with an empty draft.
- While pending, Cancel, Escape, text edits and repeat confirmation are blocked; no duplicate dispatch occurs.
- Explicit cancellation before sending preserves selection and dispatches nothing.
- A controlled list refresh before confirmation updates the targeted recipients while preserving the draft.
- A list refresh during sending does not retarget already dispatched requests.
Evidence is retained under /Users/yannick/.codex/notes/tale-1000-additional/inbox-current-recovery-next/: bulk-recovery.browser.test.tsx, parent-browser.log, bulk-refusal-reopen-empty.png. Replay from the current-source checkout's services/platform:
bunx vitest --config /Users/yannick/.codex/notes/tale-1000-additional/inbox-current-recovery-next/vitest.browser.config.ts run --reporter verboseMutation and directory hooks are controlled boundaries and toast output is captured. This proves component/hook recovery given rejected promises; it does not claim a real provider outage, HTTP rejection, database write, email delivery or full route/cache integration. No Milkdown is involved. The log retains the mixed Vitest/browser dependency-version warning.
Scope and deduplication
#3909 is shared DataTable Delete/Archive recovery in a different implementation; repairing it does not repair Send or its draft. #3912 concerns API-channel eligibility; these fixtures use valid email recipients. #3920 concerns text interpreted as HTML; this probe uses plain text without markup. Merged #3784 retains failures for status verbs, and #3905 adds send refusal reasons; neither preserves the Send retry context. All/partial refusal count together.
Acceptance: retain failed recipients and message after refusal, retry only failures, and preserve success, explicit-cancel, pending-action and refreshed-list controls.
Activity
fix(platform): let bulk Inbox Send reach API threads and keep refusals