Repository navigation
fix(core): ignore other polls' votes in StreamPollVoteListController (v9) - #3058
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v9 #3058 +/- ##
=====================================
Coverage ? 68.87%
=====================================
Files ? 435
Lines ? 27711
Branches ? 0
=====================================
Hits ? 19085
Misses ? 8626
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xsahil03x
left a comment
There was a problem hiding this comment.
Faithful v9 port of #3057: the same check in the same place, with only v9's 80-column formatting and one renamed test differing. v9's answer resolver keeps the payload, so the check holds for every event type, and CI is green.
Nit on the description, same as #3057: iOS also scopes by optionId / isAnswer; that part is #3060, so "matches iOS" here is true for the poll id only.
Submit a pull request
Linear: FLU-974
Github Issue: #
CLA
Description of the pull request
StreamPollVoteListControllerlistens tochannel.on()and passed every poll vote and answer event to its event handler without checking the poll. A channel can hold several polls, so a vote or comment on one poll showed up in another poll's votes or comments list. For example, a comment on "Team offsite" appeared in the open comments of "Lunch: pizza or sushi?".The controller now ignores vote and answer events whose vote belongs to a different poll. It reads the poll from
pollVote.pollId, falling back topoll.id. Notes:eventListenerstill receives every event before the check, as before.StreamPollVoteEventHandleris untouched.This matches the iOS SDK: its
PollVoteListControlleronly applies a vote whenquery.pollId == vote.pollId.v9 port of #3057.
Testing
stream_poll_vote_list_controller_test.dart: vote-casted, answer-casted and vote-changed events for another poll, and a vote with no poll id at all, leave the list unchanged; a vote for the same poll is still added, including one whose only poll id is on the event's poll. The four "leaves the list unchanged" tests fail without the fix; the fallback test fails without thepoll.idfallback.stream_chat_flutter_coreanalyzes clean and its full suite passes. The fallback test is renamed toa vote-casted event matching only by its event poll is addedto fit v9's 80-column limit.🤖 Generated with Claude Code
Summary by CodeRabbit