feat(relay): warn on offline explicit mentions (#1743)#1862
feat(relay): warn on offline explicit mentions (#1743)#1862cameronhotchkies wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
From my agent...
The underlying silent-stall problem is real, but this implementation does not yet provide a reliable sender warning.
Blocking issues:
-
Every
ptag is treated as an explicit mention. Buzz replies structurally include the replied-to author'sptag (desktop/src/features/messages/lib/threading.ts), so an ordinary reply to an offline author will produce a misleading “mentioned user” notice even when the message did not mention them. The wire format needs to distinguish explicit mentions from reply routing metadata (or this check needs to consume existing explicit-mention metadata). -
The desktop sender drops
NOTICEframes.RelayClientSession.handleWsMessagehandles onlyAUTH,EVENT,OK, andEOSE; ACP only writesNOTICEto its warning log. Thus normal desktop users get no visible feedback, and sending agents do not receive a machine-actionable failure signal. Please wire the result into the sender UX/agent send path so this actually fixes #1743. -
Presence is only pod-local and checks any authenticated connection, not a matching subscription/delivery. In a multi-pod deployment it can report an online recipient as offline; conversely, an unrelated authenticated socket can suppress the warning even when no harness subscription received the message. Please use authoritative cross-pod presence with semantics tied to the intended recipient/delivery guarantee, or explicitly narrow and prove the behavior.
Please also add focused relay/client tests covering accepted-only behavior, kind restriction, dedupe/self-exclusion, explicit mention vs reply-author p tags, online/offline cases, and visible handling of the notice. The current change adds no tests for this critical path.
7255308 to
3db15aa
Compare
2313a7d to
2cc3de5
Compare
When a kind:9 message carries explicit Buzz mention tags, look up Redis presence across the workspace after successful ingest and send NOTICE frames to the sender for recipients without current presence. This avoids treating reply-author p tags as mentions. Desktop send paths now attach explicit mention tags, consume relay NOTICE frames, and surface them as warning toasts. Co-authored-by: Cameron Hotchkies <chotchkies@block.xyz> Signed-off-by: Cameron Hotchkies <chotchkies@block.xyz> Co-authored-by: Goose <opensource@block.xyz> Ai-assisted: true
2cc3de5 to
71b20b5
Compare
Summary
This updates the #1743 relay warning path so senders get visible feedback when they explicitly @mention a pubkey that has no current Buzz presence in the workspace.
What changed
['mention', '<pubkey>']tags alongside deliveryptags so the relay can distinguish real @mentions from structural reply-authorptags.NOTICEback to the sender for mentioned pubkeys with no current presence.NOTICEframes as warning toasts.Validation
cargo fmt --all -- --checkcargo fmt --manifest-path desktop/src-tauri/Cargo.toml --all -- --checkcargo check -p buzz-relaycargo clippy -p buzz-relay --all-targets -- -D warningscargo test -p buzz-relay mention --libcargo test -p buzz-sdk message_mentions_emit_delivery_and_reference_tags_deduped --libcargo test --manifest-path desktop/src-tauri/Cargo.toml mention_reference --libjust desktop-test— 2983 passedjust desktop-typecheckcd desktop && pnpm check— exits 0; reports two pre-existing unused-variable warnings indesktop/tests/e2e/inbox-live-update.spec.tsanddesktop/tests/e2e/typing-latency.perf.tsNotes
/Users/chotchkies/.docker/run/docker.sockmissing). I pushed with--no-verifyafter the targeted checks above passed so CI can run on GitHub.Refs #1743.