buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Feed category contract mismatch: native emits "mentions", frontend compares "mention"

Open tlongwell-block opened this issue 4 months ago • 2 comments

Native get_feed (desktop/src-tauri/src/commands/messages.rs:105) emits feed items with category: "mentions" (plural), but every frontend comparison uses the singular "mention" — the declared FeedItemCategory union value (desktop/src/shared/api/types.ts:226). The e2e bridge also emits the singular, so relay-mode tests never see the native shape.

Demonstrated effects (native mode only):

  • Wrong toast title: notificationTitle (desktop/src/features/notifications/lib/feed.ts:44) checks category === "mention"; native mention items fall through to the fallback and render as "Needs Action in #channel" instead of "X mentioned you in #channel". Observed live during the DM double-notification investigation (block/buzz#2105): a kind-9 mention item from the mentions feed section toasted with the needs-action title.
  • Inbox labeling/priority: inbox.ts compares === "mention" for category labels, grouping priority, and mention-specific handling (desktop/src/features/home/lib/inbox.ts:162,194,253,293) — native mention items never match.
  • Any other category === "mention" consumer (sound slot selection, muted-channel exemptions if/where category-gated) silently misclassifies.

Fix direction: normalize once at the boundary (native emits the declared singular value, or fromRawFeedItem canonicalizes), plus native-shaped bridge coverage so relay-mode e2e can catch it — same pattern as the channel_type null canonicalization in #2105.

tlongwell-block avatar Jul 19 '26 02:07 tlongwell-block

Taking the native-side fix: aligning the emitted category to the singular "mention" that FeedItemCategory (types.ts), feed.ts/inbox.ts, and the e2e bridge all use. Leaving the types request-filter keyword ("mentions") untouched since that's a separate API surface. Adds a regression test. PR incoming.

Bartok9 avatar Jul 21 '26 22:07 Bartok9

Addressed by https://github.com/block/buzz/pull/6665.

ngthuydiem avatar Sep 29 '26 19:09 ngthuydiem