e2e: Cover the unread messages flows backed by the mock server read state - #6596
Conversation
The mock server now maintains per-user read state, so the unread separator and jump-to-unread tests (11453-11455) run again. Add the mark-as-unread flow (6073) and a channel list unread badge assertion, waiting for the badge before reopening the channel so the sticky unread label is computed from settled state instead of racing the event queue. The badge exposes only a content description (clearAndSetSemantics in UnreadCountIndicator removes the text and tag from the semantics tree), so the assertion matches the stream_compose_channel_item_unread plural and the stale resource-id selector is removed.
The send is asynchronous after the composer tap, so the participant's read request could reach the mock server before the message it should mark as read, leaving the message unread and the double checkmark never shown. Same fix as for the participant pin. Second-precision mock timestamps used to hide the wrong order as a tie; with real sub-second precision the order is exposed.
|
@CodeRabbit review |
✅ Action performedReview finished.
|
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
WalkthroughCompose end-to-end coverage now verifies channel unread counts, marking messages unread, unread separators, and message delivery reaching ChangesCompose E2E coverage
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 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 |
SDK Size Comparison 📏
|
… unread tests On a slow emulator the participant's first message could reach the mock server before the user's own message, changing the message order the tests rely on for the separator position and the marked message index.
|



Goal
Cover the unread messages flows now that the mock server maintains per-user read state: the unread separator, the jump-to-unread button, its dismissal, and the mark-as-unread message action. Also fix a send-read race in the read receipt tests that the mock server's new sub-second timestamps expose.
Requires GetStream/stream-chat-test-mock-server#53 to be merged first: without the mock read state, the re-enabled tests cannot pass.
Related: AND-1329. The remaining coverage of the ticket (pinned messages screen, search, block, flag, mute, channel actions, threads list, reminders) comes in a follow-up PR.
Implementation
UnreadMessagesTests: the three tests@Ignored in e2e: Cover the Compose features supported by the current mock server #6591 (Allure 11453-11455) run again, and a newtest_userMarksMessageAsUnread(Allure 6073) covers the mark-as-unread context menu action end to end, asserting the unread separator and the channel list badge.message.newevents captures a partial count.assertChannelUnreadCount: the badge exposes only a content description (clearAndSetSemanticsinUnreadCountIndicatorremoves the child text and tag from the semantics tree), so the assertion matches thestream_compose_channel_item_unreadplural and the staleStream_UnreadCountIndicatorselector is removed.MessageDeliveryStatusTests: the four tests whose READ assertions depend on the participant reading after the user's send now wait for the delivery status first, the same fix e2e: Cover the Compose features supported by the current mock server #6591 applied to the participant pin. The send is asynchronous after the composer tap, so the participant's read request could reach the mock server before the message it should mark as read. Second-precision mock timestamps used to hide the wrong order as a tie; with real sub-second precision the order is exposed and the test flaked on slower CI emulators.Testing
Ran locally against the mock server PR branch (API 35 emulator) via direct instrumentation, each test isolated with a data clear like the CI orchestrator does:
UnreadMessagesTests: 4/4MessageDeliveryStatusTests: the four adjusted tests pass, the previously flakytest_readByDecremented_whenParticipantIsRemovedthree times in a rowspotlessCheckanddetektpass on the touched module. Test-only change, no public API impact.Summary by CodeRabbit
New Features
Bug Fixes