Skip to content

fix(desktop): normalize feed item category contract to singular mention (#2106) - #2285

Open
hmadhsan wants to merge 1 commit into
block:mainfrom
hmadhsan:fix/feed-category-contract-mismatch
Open

fix(desktop): normalize feed item category contract to singular mention (#2106)#2285
hmadhsan wants to merge 1 commit into
block:mainfrom
hmadhsan:fix/feed-category-contract-mismatch

Conversation

@hmadhsan

@hmadhsan hmadhsan commented Jul 21, 2026

Copy link
Copy Markdown

Fixes #2106

🐛 What was the issue?

Native get_feed (in desktop/src-tauri/src/commands/messages.rs) was emitting feed items with category: "mentions" (plural), while the declared TypeScript FeedItemCategory union value (types.ts) and every frontend consumer (feed.ts, inbox.ts) checked against singular "mention".
As a result, in native mode, mention feed items fell through to generic notification fallbacks ("Needs Action in #channel" instead of "@Mention") and missed mention-specific inbox classification/labeling.

🛠️ What did we fix?

  • Tauri Native Backend: Updated get_feed in desktop/src-tauri/src/commands/messages.rs so feed_item_from_event receives singular "mention" instead of "mentions".
  • Frontend API Boundary: Updated fromRawFeedItem in desktop/src/shared/api/tauri.ts to canonicalize wire "mentions" to "mention" as a defensive guard.
  • Unit Tests: Added unit tests in desktop/src/shared/api/tauriFeed.test.mjs verifying category normalization.

🧪 Testing & Verification

  • Added unit tests in tauriFeed.test.mjs asserting that fromRawFeedItem canonicalizes "mentions" to "mention" and preserves "mention".
  • Verified category contract alignment across Rust models and TypeScript types.

@hmadhsan
hmadhsan requested a review from a team as a code owner July 21, 2026 21:06
…on (block#2106)

Signed-off-by: hmadhsan <hammadhassan616@gmail.com>
@hmadhsan
hmadhsan force-pushed the fix/feed-category-contract-mismatch branch from 9854a8e to 64f0c5c Compare July 21, 2026 21:08
@cameronhotchkies cameronhotchkies added the triage-ready Appropriate for agentic review label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-ready Appropriate for agentic review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants