perf(llc): make primitive value streams distinct - #2935
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe PR adds duplicate suppression to primitive-valued channel and unread-count streams. It updates count tests to verify repeated values emit once. It removes subscription-level deduplication from the message composer draft stream. ChangesStream emission behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Count streams now suppress repeated values, with tests confirming the intended behavior. No merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 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 |
Channel and ClientState getters that map to a single primitive value now dedupe, so listeners only wake up when the value actually changes rather than on every channel state or current user update. The composer's redundant `distinct()` on the draft stream is dropped, as `ChannelClientState.draftStream` and `threadDraftStream` already dedupe. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0c632c2 to
27bd68b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2935 +/- ##
=======================================
Coverage 74.23% 74.23%
=======================================
Files 437 437
Lines 28377 28377
=======================================
Hits 21066 21066
Misses 7311 7311 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ChannelandClientStategetters that map to a single primitive value emitted on every channel-state / current-user update, even when the value was unchanged. Pushing four distinct message counts throughmessageCountStreamproduced 13 emissions;memberCountStreamfired on every new message.Those getters now
.distinct(), matching the stream getters inchannel.dartthat already do (ownCapabilitiesStream,messagesStream,draftStream, …). Scope is primitives only (bool,int,String?,DateTime?) — model and collection streams are untouched.The composer's
distinct()on the draft stream is dropped as redundant;ChannelClientState.draftStreamandthreadDraftStreamalready dedupe.Verification
memberCountStream/messageCountStreamtests now push a repeated count through and assert the full emission list. Checked red againstorigin/master'schannel.dart([null, 1, 5, 10]expected,[null, null, null, 1, 1, 1, 5, 5, 5, 5, 5, 5, 10]actual) and green with this change.stream_chat:dart test1631 passing,dart analyze --fatal-infosclean.stream_chat_flutter_core:flutter test362 passing.stream_chat_flutter:flutter test1311 passing; 2 failures are pre-existing missing macOS goldens forstream_message_deleted_test.dart.🤖 Generated with Claude Code
Summary by CodeRabbit