Skip to content

feat(messages): upload attachments in the background after send - #632

Merged
wesbillman merged 9 commits into
mainfrom
peon/background-uploads
Oct 6, 2026
Merged

wesbillman merged 9 commits into
mainfrom
peon/background-uploads

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Sending a message with attachments now hands the upload to a session-owned background job, porting the base block/buzz desktop implementation: backgroundMediaUploadStore.ts and the send flow in useMentionSendFlow.ts. The composer clears immediately, so the user can keep typing or navigate away while files upload and the message publishes.

Behavior

  • Captured destination: channel, thread root, reply parent, text, recipients and references are fixed at Send. A send never follows the user to another conversation or account.
  • Progress: a pill above each composer shows Preparing / Uploading N% / Finishing with Cancel, using the block/buzz copy. Cancel stops the newest send.
  • Ordering: Send stays disabled for a draft while its background send is pending, so a follow-up cannot overtake it. Typing, navigation and other conversations stay available.
  • Failure and recovery: a failed or aborted upload (including access revocation and cache clearing) restores the text and files into the untouched draft and shows Upload failed: … or Message failed to send: …. If persistence cannot confirm restoration or the draft has since changed, the session retains the files and exposes a recovery retry without overwriting later work. A conflict asks the user to clear the later draft before retrying; accepted-cleanup state stays non-editable until resolved. Publication preparation failures return to the originating composer error state with its explicit retry control. Cancel restores silently.
  • Reply target: a delayed publish clears the thread reply target only if it is still the one chosen at Send.
  • Lifetime: jobs and files are owned by the relay session and held in memory, as in block/buzz. A disposed session never publishes. Publication goes through the existing outbox, so authorization, size limits and transport are unchanged.

Verification (current head 77ebacbdd1cfd61aa7ea74bba5419ea2596883d4)

  • Preparation failure while the composer is absent now retains a session/conversation-keyed error. On return, the saved caption and adopted files remain visible with Retry message preparation. Recovery deferred by an active message edit survives an additional unmount. A successful refresh removes the error without sending, and a subsequent remount does not replay it.
  • Fail-then-pass: the absent-composer mounted regression failed on c2255265 at the missing alert and passed after the fix. The edit-deferral remount regression and complete MessageComposer.test.tsx passed. Full vitest run at 77ebacbd: 535 files, 7,680 tests passed. Pre-commit formatting/lint and pre-push typecheck, related tests, and design guards passed. git diff --check passed. No browser journey was added or removed in this cycle: the new ordering is exercised in the colocated React mount; browser-only focus and transport coverage from the previous cycle remains unchanged.
  • Previous c2255265 hosted CI failed in Chromium shard 1/6 at tests/browser/global-search.spec.mjs:340: a resting-pointer selection expected aria-selected=true but received false. This is a different surface, not yet reproduced or dismissed as unrelated. Current-head hosted CI is in progress; do not infer CI-green from local tests. No new human test is claimed.

Review readiness

  • Peon found and we fixed a deferred-edit-unmount gap; independent rereview of 77ebacbd reports no actionable findings (minimalness/elegance/correctness: 9/9/9). The prior readiness claim at 617fe0e9 is obsolete. No current-cycle human test is claimed. PR remains open; no merge authorization is inferred.

peon added 2 commits October 5, 2026 15:48
Send hands admitted files to a session-owned background job that uploads and publishes to the destination captured at Send. The composer clears immediately; a Desktop-style progress pill offers Cancel, and failure or cancel restores the draft.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
…me-draft sends

Access revocation and cache clearing abort session uploads without closing the session; those sends now restore their text and files with the upload failure notice instead of vanishing. Send stays disabled for a draft while its background send is pending, matching Desktop, so a follow-up cannot overtake it. A delayed publish clears the thread reply target only if it is still the one captured at Send.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
@kalvinnchau
kalvinnchau marked this pull request as ready for review October 6, 2026 01:45
@kalvinnchau
kalvinnchau requested review from a team, comp615 and wesbillman as code owners October 6, 2026 01:45

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes needed: three production recovery/accessibility defects are inline.

[P2] Public-material privacy: remove the “Originating Buzz channel” name and UUID from this public PR description. They expose internal coordination/workspace identifiers and are unnecessary for reviewing the feature; retain that provenance in the private workspace instead. This is separate from the production defects.

Star Lord automated source review via Wes’s account. Head 63ee15d91c887a3277816bb656f49020a2d8b210; base aa10599d43077b92f43655fe035e1bc0ae5e6afb. Source-only: no tests, builds, app execution, or live workflow validation. One CI snapshot shows CI required failing with WebKit journey shard 4/6 failing; not triaged. Description inspected; it contains no attached images.

Comment thread src/features/messages/MessageComposer.tsx Outdated
Comment thread src/features/messages/MessageComposer.tsx
Comment thread src/features/messages/BackgroundUploadStatus.tsx
@kalvinnchau
kalvinnchau marked this pull request as draft October 6, 2026 02:27
Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
@kalvinnchau

Copy link
Copy Markdown
Contributor Author

🤖 The public PR description no longer contains the internal provenance identifiers. The PR remains draft while review and hosted checks finish.

Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
@kalvinnchau
kalvinnchau marked this pull request as ready for review October 6, 2026 03:15

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two recovery changes are still needed after composer remount (inline). The focused-Cancel repair and removal of internal PR provenance address those prior findings.

Star Lord automated follow-up source review via Wes’s account. Head f18b3aa2d74e43124e199c12b16b958416723286; base aa10599d43077b92f43655fe035e1bc0ae5e6afb. Source-only: no tests, builds, app execution, or live workflow validation. Hosted CI required passed in the snapshot; Windows validation was skipped. Public description inspected; no attached images.

Comment thread src/features/messages/MessageComposer.tsx Outdated
Comment thread src/features/messages/MessageComposer.tsx
@kalvinnchau
kalvinnchau marked this pull request as draft October 6, 2026 03:48
am added 2 commits October 5, 2026 20:57
Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
@kalvinnchau
kalvinnchau marked this pull request as ready for review October 6, 2026 04:12

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two recovery changes remain (inline). The two remount cases in the previous review are addressed; the remaining cases concern active message edits and preparation-error recovery after remount.

Star Lord automated follow-up source review via Wes’s account. Head 617fe0e9ded53876ad945a221dd798acf20354b2; base aa10599d43077b92f43655fe035e1bc0ae5e6afb. Source-only: no tests, builds, app execution, or live workflow validation. Browser shards were pending in the single hosted-check snapshot; Windows validation was skipped. Public description inspected; no attached images.

Comment thread src/features/messages/MessageComposer.tsx Outdated
Comment thread src/features/messages/MessageComposer.tsx Outdated
…very

Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preparation-error recovery is still incomplete when failure happens while the composer is unmounted (inline). The active-edit overwrite is repaired, and an already-remounted composer now receives the error.

Star Lord automated follow-up source review via Wes’s account. Head c22552655922a423bfaa08c89008d2e1c05e6e7f; base aa10599d43077b92f43655fe035e1bc0ae5e6afb. Source-only: no tests, builds or app execution. One hosted snapshot showed Chromium journey shard 1/6 failing and two WebKit shards pending; failure not triaged. Public description inspected; no attached images.

Comment thread src/features/messages/MessageComposer.tsx
am added 2 commits October 5, 2026 22:38
Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
@kalvinnchau

Copy link
Copy Markdown
Contributor Author

🤖 Addressed review comment 4191824333 at 77ebacbdd1cfd61aa7ea74bba5419ea2596883d4. A session/key-scoped missed preparation error is retained when upload/publication fails without a composer, replayed only while its restored draft still owns the saved revision, and consumed when shown (including deferred edit recovery). The mounted absent-composer case failed at the missing alert on c2255265, then passed; edit → failure → unmount → return and stale-error-after-refresh regressions pass. Full Vitest: 535 files / 7,680 tests; hooks passed; peon rereview found no actionable findings. Current-head hosted CI is still in progress. Previous-head Chromium shard 1/6 failed in global-search pointer selection and is not yet dismissed.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes requested for this follow-up. The remaining preparation-retry finding is addressed: failures survive an absent composer or deferred-edit unmount, replay only against the matching saved draft, and reach the explicit retry control.

Star Lord automated source review via Wes’s account; head 77ebacbdd1cfd61aa7ea74bba5419ea2596883d4, base aa10599d43077b92f43655fe035e1bc0ae5e6afb. Source-only review of the two-file repair and its collaborators: no tests or app execution; the CI snapshot still had browser shards running and Windows skipped, so runtime/focus acceptance remains unverified.

@wesbillman
wesbillman merged commit 09eb1a6 into main Oct 6, 2026
22 checks passed
@wesbillman
wesbillman deleted the peon/background-uploads branch October 6, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants