Skip to content

Defer desktop media uploads until send - #4522

Merged
wesbillman merged 27 commits into
mainfrom
kennylopez-desktop-background-uploads
Aug 4, 2026
Merged

Defer desktop media uploads until send#4522
wesbillman merged 27 commits into
mainfrom
kennylopez-desktop-background-uploads

Conversation

@klopez4212

@klopez4212 klopez4212 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • send desktop messages immediately while media uploads continue in background state across channel navigation
  • show immediate progress above the composer and keep Jump to latest above it
  • report the real media stages as Preparing, Processing, Converting, Uploading, and Finishing
  • use Buzz's shared spinner during local media work, then switch to the real percentage when byte transfer begins
  • animate phase-label and status-suffix changes without overlap or layout jumps
  • keep cancel, progress fill, message publication, and community-reset behavior coordinated with the background task
  • use raw Tauri IPC for large browser files so renderer-side byte serialization does not block initial feedback

Why

Desktop previously blocked sending while attachments uploaded in the composer. Large videos could also pause the renderer before progress appeared, and the progress pill said Uploading while native media processing was still underway. This makes the initial response immediate and describes the work actually happening.

Validation

  • cd desktop && pnpm check
  • cd desktop && pnpm typecheck
  • cd desktop && pnpm test (3,931 passed)
  • cd desktop && pnpm exec vite build --mode e2e
  • cd desktop && pnpm exec playwright test tests/e2e/file-attachment.spec.ts --project=smoke (11 passed)
  • focused native media tests (80 passed)
  • native Clippy with all targets and features
  • pre-push native suite (2,107 passed, 14 ignored; 3 diagnostics passed)

Updated phase snapshots are included in the PR comments.

Split from #4512 so the desktop and mobile changes can be reviewed independently.

Signed-off-by: kenny lopez <klopez4212@gmail.com>
klopez4212 added a commit that referenced this pull request Aug 3, 2026
@klopez4212
klopez4212 marked this pull request as ready for review August 3, 2026 13:15
@klopez4212
klopez4212 requested a review from a team as a code owner August 3, 2026 13:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9bd50eca0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/lib/useMediaUpload.ts
Comment thread desktop/src/features/messages/ui/submitMessageEdit.ts Outdated
Comment thread desktop/src/features/messages/lib/backgroundMediaUploadStore.ts Outdated
Comment thread desktop/src/features/messages/lib/backgroundMediaUploadStore.ts Outdated
Signed-off-by: kenny lopez <klopez4212@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

if (draft.sentDraftKey) {
drafts.markDraftSent(
draft.sentDraftKey,

P1 Badge Avoid clearing a newer persisted draft after upload completion

With a slow queued upload, a user can submit one message, begin another in the same channel, and navigate away, causing the newer text to be persisted under the same draft key. When the first upload later succeeds, this delayed call reaches markDraftSentEntry, which unconditionally calls clearDraftEntry, deleting that newer draft; the completion needs to clear only the captured draft version rather than whichever entry currently owns the key.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/ui/useMentionSendFlow.ts
Comment thread desktop/src/features/messages/ui/MessageComposer.tsx Outdated
Signed-off-by: kenny lopez <klopez4212@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60022c5487

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/lib/backgroundMediaUploadStore.ts Outdated
Comment thread desktop/src/features/messages/ui/MessageComposer.tsx
Signed-off-by: kenny lopez <klopez4212@gmail.com>
klopez4212 added a commit that referenced this pull request Aug 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96fa445edc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/ui/ComposerAttachments.tsx
Comment thread desktop/src-tauri/src/commands/media_raw.rs Outdated
Signed-off-by: kenny lopez <klopez4212@gmail.com>
klopez4212 added a commit that referenced this pull request Aug 3, 2026
Signed-off-by: kenny lopez <klopez4212@gmail.com>
klopez4212 added a commit that referenced this pull request Aug 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 891fc43fb1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/ui/MessageComposer.tsx
Signed-off-by: kenny lopez <klopez4212@gmail.com>
klopez4212 added a commit that referenced this pull request Aug 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5697f36ada

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/lib/backgroundMediaUploadStore.ts Outdated
Signed-off-by: kenny lopez <klopez4212@gmail.com>
klopez4212 added a commit that referenced this pull request Aug 3, 2026
@klopez4212

Copy link
Copy Markdown
Contributor Author

🤖 Updated desktop upload-status snapshots using Buzz's shared loading spinner.

Processing

Local media work uses the shared indeterminate arc spinner instead of a misleading percentage.

processing-spinner

Uploading

The spinner transitions to byte-transfer progress once the upload begins.

uploading-percentage

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d47e8d6f29

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/lib/backgroundMediaUploadStore.ts Outdated
Signed-off-by: kenny lopez <klopez4212@gmail.com>
…ckground-uploads

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: kenny lopez <klopez4212@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f1b3e69bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/messages/ui/useMentionSendFlow.ts
Comment thread desktop/src/features/messages/ui/submitMessageEdit.ts Outdated
Comment thread desktop/src/shared/api/tauriMedia.ts Outdated
Signed-off-by: kenny lopez <klopez4212@gmail.com>
…ckground-uploads

Signed-off-by: kenny lopez <klopez4212@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f227cbba7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +489 to +490
) {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Retain failed sends alongside newer same-channel drafts

When upload A fails after the user has begun draft B in the same channel, the stored entry differs from A, so this return skips persisting A; canRestoreCurrentComposer is also false because B is active, while the queued-file fallback runs only for an off-channel composer. The task then finishes and drops its only references to A's local files, silently losing the submitted message. Fresh evidence beyond the earlier text-preservation response is that the mismatch guard protects B without placing A in any separate recovery entry.

Useful? React with 👍 / 👎.

Comment on lines +531 to +535
restoreComposer: (draft) => {
setComposerContent(draft.content);
richText.setContent(draft.content);
media.setPendingImeta(draft.pendingImeta);
media.restoreQueuedAttachments(draft.queuedAttachments);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore mention routing when recovering an edit

If an edit upload fails or is canceled after adding an autocomplete-selected non-member, agent, or persona mention, clearComposer has already cleared the mention maps, but this recovery callback restores only text and attachments. Retrying the visible edit can therefore make extractMentionPubkeys omit that recipient and publish without the intended routing tag. Fresh evidence beyond the normal-send mention-recovery finding is that this edit-specific restoration path still does not snapshot and restore getDraftMentionRefs/restoreDraftMentionRefs.

Useful? React with 👍 / 👎.

@klopez4212

Copy link
Copy Markdown
Contributor Author

🤖 @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f227cbba7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +118 to +120
// Files cannot be serialized into the draft store. Dropping the in-memory
// queue here prevents it from being sent in the next channel or thread.
clearQueuedAttachments?.();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Retain queued files when switching drafts

When a user selects a deferred attachment and then switches channels or threads before sending, this clears the outgoing queue without storing it under the outgoing draft key; the effect cleanup persists only text and already-uploaded pendingImeta. Returning to the draft therefore loses every selected local file, and an attachment-only draft disappears completely. Preserve the outgoing queued attachments in the community-reset-aware store before clearing them, including on composer unmount.

Useful? React with 👍 / 👎.

Comment on lines +318 to +322
export function saveQueuedAttachmentsForDraft(
draftKey: string,
attachments: QueuedMediaAttachment[],
): void {
queuedAttachmentsByDraftKey.set(draftKey, attachments);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear retained files when deleting a recovered draft

After an off-channel upload failure stores attachments in this map, deleting the recovered draft only calls clearDraftEntry (useHomeDrafts.ts) and leaves this entry intact. Navigating to that channel later calls takeQueuedAttachmentsForDraft even though no saved draft exists, unexpectedly restoring the supposedly deleted files and retaining potentially large File objects in memory until then; draft deletion should clear the matching retained attachment entry as well.

Useful? React with 👍 / 👎.

Signed-off-by: kenny lopez <klopez4212@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 279294ee24

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

);
const managedAgentsByPubkey = await getManagedAgentsByPubkey();
if (!isMountedRef.current) {
persistPreflightDraft();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prevent preflight recovery after a community switch

If a community switch unmounts this composer while an agent/DM preflight await is pending, resetCommunityState() first clears the draft and background-upload stores, but the old continuation can then reach this call and repopulate them. If it resumes after the new community's initDraftStore, the outgoing community's text is written into the new community's draft bucket; saveQueuedAttachmentsForDraft also restores its local files into the reset module-level map regardless of timing. Bind recovery to the originating community generation so stale preflights cannot write after teardown.

AGENTS.md reference: AGENTS.md:L511-L513

Useful? React with 👍 / 👎.

@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.

Reviewing on Wes's behalf. Two blocking issues need correction before this is safe to merge. The branch also currently conflicts with main, and desktop CI is failing at TypeScript compilation, so the behavior suites have not validated the final change.


// Files cannot be serialized into the draft store. Dropping the in-memory
// queue here prevents it from being sent in the next channel or thread.
clearQueuedAttachments?.();

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.

P1 — Preserve ordinary queued attachments across draft-key changes. This unconditionally destroys the current channel/thread's local queue, but only canceled/failed submitted uploads are ever placed in queuedAttachmentsByDraftKey. Normal queued files are not serialized by persistDraft either (it only receives pendingImeta), so switching channels before Send permanently loses the attachments; an attachment-only draft is also treated as empty and cleared. Please retain queued files under the outgoing draft key before clearing, then restore them for the incoming key. Add coverage for switching away and back before Send for both text+file and file-only drafts; the current cross-channel E2E starts the upload before switching and does not exercise this loss path. — Carl, reviewing on Wes's behalf

spoileredAttachmentUrls: Set<string>;
};

type SubmitMessageEditOptions = EditDraft & {

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.

P1 — Fix the required input type; the PR does not compile. Because this type extends EditDraft, callers must supply mentionRefs, but MessageComposer does not. CI fails with TS2345 at MessageComposer.tsx:509, preventing Desktop Core/build/E2E from running. This function derives mentionRefs itself at lines 62–68, so the smallest fix is to define the options as Omit<EditDraft, "mentionRefs"> & { ... } (or otherwise remove that redundant required input), then rerun CI. — Carl, reviewing on Wes's behalf

wesbillman and others added 2 commits August 3, 2026 18:27
Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Keep locally queued files scoped to their outgoing draft key while switching
channels or threads, then restore them when the draft becomes active again.
Also remove the redundant mentionRefs requirement from message-edit submission.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman
wesbillman dismissed their stale review August 4, 2026 00:35

The two blocking findings are fixed at ea1ccc2, with regression coverage and current main merged. Clearing my requested-changes review on Wes’s behalf; this is not an approval.

@wesbillman

Copy link
Copy Markdown
Collaborator

Fixed both review blockers directly at ea1ccc269baa56ae1dd85aa9be681d17723e6888 and merged current main via 23e875a06a6f1b889d3aace326a5787285ced40d.

  • queued local attachments are now retained per draft key across channel/thread switches, with an attachment-only A → B → A regression test
  • SubmitMessageEditOptions no longer redundantly requires mentionRefs
  • local validation passed: desktop typecheck, all 4,046 desktop unit tests, pnpm check, pnpm build:e2e, Biome, and the file-size ratchet

The pre-push suite also passed branch-skew, desktop-check, and desktop-test; its Rust phase hit one unchanged paused-time test failure in relay_admission::tests::concurrent_429_extends_the_window_for_parked_waiters (observed 300.001s vs expected 5s). desktop/src-tauri/src/relay_admission.rs is identical to origin/main on this branch. CI is the authority for that unrelated result.

I am posting and clearing my prior requested-changes review on Wes’s behalf; this comment is not an approval.

@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.

Reviewing on Wes's behalf at exact head ea1ccc269baa56ae1dd85aa9be681d17723e6888.

The draft-key retention fix leaves one user-visible deletion path inconsistent: deleting a draft from the Drafts panel clears only the persisted DraftState. The PR's new queuedAttachmentsByDraftKey store has no keyed clear operation, and useHomeDrafts.deleteDraft never touches it. For a text + locally queued attachment draft, switching away saves the File objects in that map; deleting the visible draft from Home removes only localStorage; revisiting the channel then calls takeQueuedAttachmentsForDraft before finding no persisted draft and restores those explicitly deleted files into the composer. It also retains potentially large/sensitive File objects in memory indefinitely until that key is revisited or the entire store resets.

Please add a keyed discard API and invoke it from explicit draft deletion (including migrated/renamed draft paths if they can own retained files), with a regression test for: queue text + file in A → switch to B → delete A in Drafts → revisit A → neither text nor attachment returns.

Add an explicit draft-deletion path that removes retained local attachments
before clearing the persisted draft, preventing deleted files from resurfacing.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman

Copy link
Copy Markdown
Collaborator

Fixed the remaining explicit-deletion lifecycle bug at 57779f112af3a2402fe66b9a604dc19a5c0cbc49.

The Home delete action now uses an explicit deleteDraftEntry operation that discards draft-keyed local File objects before clearing persisted draft state. Automatic empty/sent cleanup keeps using clearDraftEntry, so it does not accidentally discard files during ordinary composer lifecycle transitions. Added regression coverage proving an explicitly deleted draft has no retained attachments to restore.

Validation at this exact commit:

  • pnpm typecheck
  • all 4,047 desktop unit tests
  • pnpm check
  • focused Biome check and file-size ratchet

Posting this update on Wes’s behalf. I have not approved the PR.

brow added a commit that referenced this pull request Aug 4, 2026
## Summary

- make mobile unread state visible with bold channel names, an animated
Inbox badge, and swipe-to-toggle Inbox rows
- add directional transitions for top-level mobile navigation
- let mobile send while media uploads, with cancellable progress UI
- normalize iOS and Android video uploads, attach poster frames, and
improve native video playback

## Validation

- `just mobile-check`
- `just mobile-test`
- `cargo test -p buzz-media`
- Pixel smoke test
- iPhone smoke test

Desktop background uploads moved to #4522 so the two platforms can be
reviewed independently.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: leader <71e9f2c44a6932b6772caaaccda1911d010463c3e2c6c40410b8329956046801@buzz.block.builderlab.xyz>
Co-authored-by: Tom Brow <tomb@block.xyz>
@wesbillman
wesbillman dismissed their stale review August 4, 2026 13:55

Re-reviewed on Wes’s behalf at exact head 57779f1. The requested keyed discard path and regression coverage are present, all current CI checks are green, and the prior blocker is resolved. Dismissing the stale changes-requested review; this is not an approval.

@wesbillman
wesbillman merged commit f18a9cb into main Aug 4, 2026
27 checks passed
@wesbillman
wesbillman deleted the kennylopez-desktop-background-uploads branch August 4, 2026 13:59
joahg added a commit to joahg/buzz-dev-mode that referenced this pull request Aug 4, 2026
…-style

* origin/main:
  docs(acp): explain per-channel session model in base prompt (block#4729)
  docs(nip-am): normative amendment — cache SHOULD/MUST + pricingIdentity + consumer cost guidance (block#4632)
  Remove blur from Welcome composer guidance (block#4691)
  Refine desktop timeline activity presentation (block#4582)
  Defer desktop media uploads until send (block#4522)
  fix(desktop): stop clipping focus ring on channel intro action cards (block#2392) (block#4374)

Signed-off-by: Joah Gerstenberg <joah@squareup.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019fcd5d-4e57-7288-a0cb-2dc6275be659
Co-authored-by: Amp <amp@ampcode.com>
Buzz-Message: buzz://message?channel=59c4e3cb-6047-4dd3-8557-7f0bebc4c967&id=5476ed95e45464e0713fcdb302d752a84b7ecb431b693bd3c7a9de20eb405d7b
wpfleger96 pushed a commit that referenced this pull request Aug 4, 2026
…-links-fixes

* origin/main:
  feat(desktop): surface config diff in restart-required badge (#3637)
  Polish sidebar unread hierarchy (#4573)
  fix(desktop): show cached display names on startup (#3317)
  docs(acp): explain per-channel session model in base prompt (#4729)
  docs(nip-am): normative amendment — cache SHOULD/MUST + pricingIdentity + consumer cost guidance (#4632)
  Remove blur from Welcome composer guidance (#4691)
  Refine desktop timeline activity presentation (#4582)
  Defer desktop media uploads until send (#4522)
  fix(desktop): stop clipping focus ring on channel intro action cards (#2392) (#4374)

Signed-off-by: npub1g8493u0xfsjrvflg4n08ezd7vec99mnwzlv0qgwpr9d7gvjwhuzqx59rhw <41ea58f1e64c243627e8acde7c89be667052ee6e17d8f021c1195be4324ebf04@buzz.block.builderlab.xyz>
tellaho pushed a commit that referenced this pull request Aug 4, 2026
…theme-config

* origin/main:
  feat(desktop): persist sidebar observed-unread across webview reload (#3976)
  feat(desktop): surface config diff in restart-required badge (#3637)
  Polish sidebar unread hierarchy (#4573)
  fix(desktop): show cached display names on startup (#3317)
  docs(acp): explain per-channel session model in base prompt (#4729)
  docs(nip-am): normative amendment — cache SHOULD/MUST + pricingIdentity + consumer cost guidance (#4632)
  Remove blur from Welcome composer guidance (#4691)
  Refine desktop timeline activity presentation (#4582)
  Defer desktop media uploads until send (#4522)
  fix(desktop): stop clipping focus ring on channel intro action cards (#2392) (#4374)
  Polish mobile inbox and media flows (#4512)
  feat: ship Buzz Term (#4347)

Signed-off-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@buzz.block.builderlab.xyz>
tellaho pushed a commit that referenced this pull request Aug 4, 2026
…onfig

* origin/main:
  feat(desktop): persist sidebar observed-unread across webview reload (#3976)
  feat(desktop): surface config diff in restart-required badge (#3637)
  Polish sidebar unread hierarchy (#4573)
  fix(desktop): show cached display names on startup (#3317)
  docs(acp): explain per-channel session model in base prompt (#4729)
  docs(nip-am): normative amendment — cache SHOULD/MUST + pricingIdentity + consumer cost guidance (#4632)
  Remove blur from Welcome composer guidance (#4691)
  Refine desktop timeline activity presentation (#4582)
  Defer desktop media uploads until send (#4522)
  fix(desktop): stop clipping focus ring on channel intro action cards (#2392) (#4374)
  Polish mobile inbox and media flows (#4512)
  feat: ship Buzz Term (#4347)

Signed-off-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@buzz.block.builderlab.xyz>
wpfleger96 pushed a commit that referenced this pull request Aug 4, 2026
…-phase2-integration

* origin/main: (23 commits)
  Refine community invite links (#4734)
  feat(desktop): persist sidebar observed-unread across webview reload (#3976)
  feat(desktop): surface config diff in restart-required badge (#3637)
  Polish sidebar unread hierarchy (#4573)
  fix(desktop): show cached display names on startup (#3317)
  docs(acp): explain per-channel session model in base prompt (#4729)
  docs(nip-am): normative amendment — cache SHOULD/MUST + pricingIdentity + consumer cost guidance (#4632)
  Remove blur from Welcome composer guidance (#4691)
  Refine desktop timeline activity presentation (#4582)
  Defer desktop media uploads until send (#4522)
  fix(desktop): stop clipping focus ring on channel intro action cards (#2392) (#4374)
  Polish mobile inbox and media flows (#4512)
  feat: ship Buzz Term (#4347)
  feat(mobile): sync per-group channel sorting (#4231)
  feat(mobile): add channel scroll navigation (#4239)
  feat(desktop): redesign the Huddle experience (#4281)
  feat(mobile): bring channel menus to desktop parity (#3940)
  feat(agents): model-tuning parity in global Agent Defaults editor (#4578)
  Polish Share Compute settings (#3735)
  fix(reactions): wrap long popover names (#3834)
  ...
wpfleger96 added a commit that referenced this pull request Aug 4, 2026
…opagation, tests

True git rebase onto bc9e652 (current origin/main). Conflict resolution
preserves #3637 (spawn_snapshot, restart-diff) and #4522 (media_raw, deferred
uploads) alongside all B1 content.

Fix 3b (hash-verified file recovery):
- schema.rs: add agents_content_hash / teams_content_hash columns to
  file_commit_phases (schema v3 with ALTER TABLE migration for existing DBs).
- txn.rs: compute SHA-256 of staged payloads and record them in the intent row.
- Recovery now verifies canonical file hash against recorded hash before
  treating absent stage files as 'already completed'. All three missing-stage
  branches (intent/both-absent, intent/teams-absent, first_renamed/teams-absent)
  fail closed unless canonical matches. Only hash-verified canonicals advance
  to committed.

Fix 4 (tombstone/archive propagation):
- agents.rs: tombstone_managed_agent_pending and archive_managed_agent_pending
  use .map_err(|e| ...)?  — failures surface in the delete command's Result.
- personas/mod.rs: same pattern for cascaded agent tombstones and persona tombstone.
- teams.rs: tombstone_team_pending and cascaded persona tombstones propagate.
- agents_retain.rs: retain_managed_agent_pending keeps its outer log-and-swallow
  with an explicit comment documenting the boot-reconcile-recoverable contract
  (Thufir accepted this distinction for updates vs deletes).

Tests:
- store_journal_fix_tests.rs (5 new tests):
  - test_file_recovery_rename_done_phase_not_updated_succeeds: both stages absent,
    canonicals match hashes → advance to committed.
  - test_file_recovery_hash_mismatch_fails_closed: hash mismatch → uncommitted.
  - test_file_recovery_first_renamed_teams_done_hash_verified: teams hash verified.
  - test_file_recovery_first_renamed_teams_absent_no_hash_fails_closed: fail closed.
  - test_boot_recovery_inserts_into_supplied_retention_path_not_flat: scoped path.
- storage_tests.rs (2 new tests): keyring round-trip (Fix 2 coverage).

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96 added a commit that referenced this pull request Aug 4, 2026
…opagation, tests

True git rebase onto bc9e652 (current origin/main). Conflict resolution
preserves #3637 (spawn_snapshot, restart-diff) and #4522 (media_raw, deferred
uploads) alongside all B1 content.

Fix 3b (hash-verified file recovery):
- schema.rs: add agents_content_hash / teams_content_hash columns to
  file_commit_phases (schema v3 with ALTER TABLE migration for existing DBs).
- txn.rs: compute SHA-256 of staged payloads and record them in the intent row.
- Recovery now verifies canonical file hash against recorded hash before
  treating absent stage files as 'already completed'. All three missing-stage
  branches (intent/both-absent, intent/teams-absent, first_renamed/teams-absent)
  fail closed unless canonical matches. Only hash-verified canonicals advance
  to committed.

Fix 4 (tombstone/archive propagation):
- agents.rs: tombstone_managed_agent_pending and archive_managed_agent_pending
  use .map_err(|e| ...)?  — failures surface in the delete command's Result.
- personas/mod.rs: same pattern for cascaded agent tombstones and persona tombstone.
- teams.rs: tombstone_team_pending and cascaded persona tombstones propagate.
- agents_retain.rs: retain_managed_agent_pending keeps its outer log-and-swallow
  with an explicit comment documenting the boot-reconcile-recoverable contract
  (Thufir accepted this distinction for updates vs deletes).

Tests:
- store_journal_fix_tests.rs (5 new tests):
  - test_file_recovery_rename_done_phase_not_updated_succeeds: both stages absent,
    canonicals match hashes → advance to committed.
  - test_file_recovery_hash_mismatch_fails_closed: hash mismatch → uncommitted.
  - test_file_recovery_first_renamed_teams_done_hash_verified: teams hash verified.
  - test_file_recovery_first_renamed_teams_absent_no_hash_fails_closed: fail closed.
  - test_boot_recovery_inserts_into_supplied_retention_path_not_flat: scoped path.
- storage_tests.rs (2 new tests): keyring round-trip (Fix 2 coverage).

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96 added a commit that referenced this pull request Aug 4, 2026
* commit 'ce3cf3cd2': (76 commits)
  Polish Huddle voice controls (#4694)
  fix(local-archive): default both archive settings to enabled (#4750)
  fix(mobile): stop oversized read-state retry loop (#4595)
  fix(desktop): close reconnect gaps that previously required CMD+R (#4737)
  Dock Buzz Term within channel workspace (#4724)
  perf(relay): index channel-id lookups and skip trace-only reads (#4647)
  fix(agents): canonicalize stale persona harness pins (#4631)
  Refine community invite links (#4734)
  feat(desktop): persist sidebar observed-unread across webview reload (#3976)
  feat(desktop): surface config diff in restart-required badge (#3637)
  Polish sidebar unread hierarchy (#4573)
  fix(desktop): show cached display names on startup (#3317)
  docs(acp): explain per-channel session model in base prompt (#4729)
  docs(nip-am): normative amendment — cache SHOULD/MUST + pricingIdentity + consumer cost guidance (#4632)
  Remove blur from Welcome composer guidance (#4691)
  Refine desktop timeline activity presentation (#4582)
  Defer desktop media uploads until send (#4522)
  fix(desktop): stop clipping focus ring on channel intro action cards (#2392) (#4374)
  Polish mobile inbox and media flows (#4512)
  feat: ship Buzz Term (#4347)
  ...

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96 added a commit that referenced this pull request Aug 4, 2026
…opagation, tests

True git rebase onto bc9e652 (current origin/main). Conflict resolution
preserves #3637 (spawn_snapshot, restart-diff) and #4522 (media_raw, deferred
uploads) alongside all B1 content.

Fix 3b (hash-verified file recovery):
- schema.rs: add agents_content_hash / teams_content_hash columns to
  file_commit_phases (schema v3 with ALTER TABLE migration for existing DBs).
- txn.rs: compute SHA-256 of staged payloads and record them in the intent row.
- Recovery now verifies canonical file hash against recorded hash before
  treating absent stage files as 'already completed'. All three missing-stage
  branches (intent/both-absent, intent/teams-absent, first_renamed/teams-absent)
  fail closed unless canonical matches. Only hash-verified canonicals advance
  to committed.

Fix 4 (tombstone/archive propagation):
- agents.rs: tombstone_managed_agent_pending and archive_managed_agent_pending
  use .map_err(|e| ...)?  — failures surface in the delete command's Result.
- personas/mod.rs: same pattern for cascaded agent tombstones and persona tombstone.
- teams.rs: tombstone_team_pending and cascaded persona tombstones propagate.
- agents_retain.rs: retain_managed_agent_pending keeps its outer log-and-swallow
  with an explicit comment documenting the boot-reconcile-recoverable contract
  (Thufir accepted this distinction for updates vs deletes).

Tests:
- store_journal_fix_tests.rs (5 new tests):
  - test_file_recovery_rename_done_phase_not_updated_succeeds: both stages absent,
    canonicals match hashes → advance to committed.
  - test_file_recovery_hash_mismatch_fails_closed: hash mismatch → uncommitted.
  - test_file_recovery_first_renamed_teams_done_hash_verified: teams hash verified.
  - test_file_recovery_first_renamed_teams_absent_no_hash_fails_closed: fail closed.
  - test_boot_recovery_inserts_into_supplied_retention_path_not_flat: scoped path.
- storage_tests.rs (2 new tests): keyring round-trip (Fix 2 coverage).

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
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