Allow Huddle between 2 humans in DM#1347
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72ad312dfb
ℹ️ 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".
72ad312 to
85522ea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85522eaef4
ℹ️ 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".
85522ea to
b5a8c18
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5a8c187b7
ℹ️ 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".
wesbillman
left a comment
There was a problem hiding this comment.
Adversarial review: I found one CHANGE blocker.
CHANGE: DM huddle starts must notify / mark unread
For inactive DMs, the kind:48100 huddle-start card is the invite. Right now it can arrive silently: no sidebar unread badge and no desktop DM notification unless the recipient already has that DM open.
Why:
KIND_HUDDLE_STARTEDis inCHANNEL_EVENT_KINDSand renders as visible timeline content (desktop/src/shared/constants/kinds.ts).- But unread and DM desktop notifications are driven by
CHANNEL_MESSAGE_EVENT_KINDS, which still excludes huddle starts. useLiveChannelUpdatesonly bumps unread forUNREAD_TRIGGER_KINDS = CHANNEL_MESSAGE_EVENT_KINDS, andhandleDmEventonly notifies whenisDmNotifiableKind(event.kind)passes.isDmNotifiableKindis also exactlyCHANNEL_MESSAGE_EVENT_KINDS.
That violates the PR’s DM use case: in a 1:1 DM, the other human can miss the huddle invitation entirely. It also conflicts with the huddle lifecycle-as-events model: this lifecycle event is an invitation, not background metadata.
Suggested fix: treat KIND_HUDDLE_STARTED as a DM activity trigger/notification — either include it in the trigger set with care for non-DM unread semantics, or add a separate DM-only huddle notification path. Keep participant join/left/end excluded from unread; the start card is the actionable event.
Other adversarial notes
- The protocol shape is otherwise aligned with
VISION.md: huddle lifecycle remains Nostr events (48100–48103) with channel scoping viahtags, and transcript posting is now opt-in. - The existing relay TODO around client-supplied
parent_channel_idincrates/buzz-relay/src/audio/handler.rsis pre-existing, not introduced here, but this PR does lean harder on it for DM joins. I’d track it as a follow-up hardening item. TESTING.mdhas no huddle-specific live smoke path; I validated the feasible targeted suite and leaned on CI for the broader matrix.
Validation I ran
cd desktop && pnpm exec node --import ./test-loader.mjs --experimental-strip-types --test ...focused huddle/thread/message constants tests ✅ (60 tests)cd desktop && pnpm check && pnpm typecheck✅cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --check✅cargo check --manifest-path desktop/src-tauri/Cargo.tomlattempted, but local build setup is missingdesktop/src-tauri/binaries/buzz-acp-aarch64-apple-darwin; GitHub CI’s Rust/Desktop checks are green.- GitHub checks for PR #1347 are green, including Desktop, Mobile, Rust Lint, Desktop E2E, and Windows Rust.
Verdict: Request changes until DM huddle starts produce the expected unread/notification signal.
|
Follow-up/refinement after reconciling with Brain: please keep the fix DM-scoped. I would not add Preferred shape: add a DM-only notifiable/unread trigger set such as: const DM_NOTIFIABLE_KINDS = [...CHANNEL_MESSAGE_EVENT_KINDS, KIND_HUDDLE_STARTED];Then use that for DM notification + DM unread handling only. Keep A good regression test would assert both sides:
|
b5a8c18 to
668c557
Compare
|
🤖 Addressed the requested change in What changed:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 668c5575a4
ℹ️ 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 isStaleUnconfirmedHuddle = | ||
| !isCurrentHuddle && isHuddleStartStale(message.createdAt); |
There was a problem hiding this comment.
Confirm lifecycle before enabling huddle joins
The stale guard only disables cards after the one-hour TTL, so it does not cover a busy channel/DM that produces more than 100 huddle lifecycle events within that hour. Because subscribeToHuddleEvents only replays the last 100 lifecycle events, an ended huddle's 48103 can fall out of the replay while this age check is still false; the card then reconstructs from the seeded 48100 only and enables Join into an already archived room. Fresh evidence beyond the prior stale-card fix is that this path still fails when the lifecycle window is exceeded before HUDDLE_JOINABLE_WINDOW_SECONDS elapses.
Useful? React with 👍 / 👎.
Brings the merged #1321 multi-tenant relay rewrite (and other main commits) under the chart-fix branch so #1348 renders and tests against current main. No conflicts. Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz> * origin/main: Multi-tenant Buzz relay: community_id as a server-resolved key (comprehensive rewrite) (#1321) Disable persona start while runtime discovery runs (#1353) chore(deps): update dependency @tanstack/react-virtual to v3.14.4 (#1342) Fix sidebar unread indicator placement (#1319) fix(desktop): un-clip hover action bar's upward bleed under content-visibility (#1354) Allow Huddle between 2 humans in DM (#1347) chore(release): release Buzz Desktop version 0.3.36 (#1352) Polish agent runtime cards (#1327) Rework desktop message-timeline scrolling: de-virtualize + native overflow-anchor (#1338) Keep wave huddles pending for placeholder profiles (#1349)
Summary
Screenshots
Tests
pnpm --dir desktop checkpnpm --dir desktop exec node --import ./test-loader.mjs --experimental-strip-types --test src/features/huddle/lib/huddleChannelName.test.mjs src/features/channels/lib/huddleAvailability.test.mjs src/features/messages/lib/threadPanel.test.mjs src/features/messages/lib/messageQueryKeys.test.mjs src/features/messages/lib/formatTimelineMessages.test.mjspnpm --dir desktop exec tsc --noEmitcargo fmt --manifest-path desktop/src-tauri/Cargo.toml --checkcargo check --manifest-path desktop/src-tauri/Cargo.tomljust desktop-screenshot --name huddle-dm-card --messages /tmp/sprout-huddle-pr/huddle-message.json --viewport 1280x720 --wait 2000 --outdir /tmp/sprout-huddle-pr/screenshotsjust desktop-screenshot --name huddle-card-closeup --messages /tmp/sprout-huddle-pr/huddle-message.json --viewport 1280x720 --wait 2000 --clip 300,320,500,130 --outdir /tmp/sprout-huddle-pr/screenshotscheck-push-org,desktop-test,mobile-test,rust-tests,desktop-tauri-test