fix(MessageList): don't count thread replies toward channel unread UI state#3229
fix(MessageList): don't count thread replies toward channel unread UI state#3229MartinCupela wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesThread reply unread state fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: -20 B (0%) Total Size: 797 kB 📦 View Changed
ℹ️ View Unchanged
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3229 +/- ##
==========================================
- Coverage 84.20% 84.18% -0.02%
==========================================
Files 485 485
Lines 14867 14868 +1
Branches 4704 4705 +1
==========================================
- Hits 12519 12517 -2
- Misses 2348 2351 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Problem
Posting a reply into a thread could surface the
UnreadMessagesNotificationin the mainMessageList.handleMessageNewincrementedchannelUnreadUiState.unread_messagesfor everymessage.newevent when the list was scrolled up, marked unread, or the tab was hidden — including pure thread replies that don't render in the main list. With noUnreadMessagesSeparatorpresent, the notification then popped.Fix
Early-return from
handleMessageNewwhen the event doesn't update the main channel (parent_idset and notshow_in_channel), so thread-only replies never touch the channel's unread UI state. Replies withshow_in_channel: truestill increment correctly.Thread unread indicators are unaffected — they come from stream-chat's separate
ThreadStatestore, and the notification is!threadList-gated.Tests
Added regression coverage for the three increment triggers (scrolled-up, marked-unread, document-hidden) with a thread reply, plus a positive
show_in_channelcase. Verified the new tests fail without the fix.Summary by CodeRabbit