Feed category contract mismatch: native emits "mentions", frontend compares "mention"
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.