Repository navigation
fix(core): ignore other polls' votes in StreamPollVoteListController - #3057
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StreamPollVoteListController
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3057 +/- ##
==========================================
+ Coverage 78.29% 78.45% +0.15%
==========================================
Files 452 452
Lines 29409 29413 +4
==========================================
+ Hits 23025 23075 +50
+ Misses 6384 6338 -46 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xsahil03x
left a comment
There was a problem hiding this comment.
Verified against the backend: every poll vote event carries poll and a non-omitempty poll_vote.poll_id, and the answer resolvers keep the payload, so the check holds for every event type. Tests pass, and both failure claims in the description reproduce.
Nit on the description: iOS's PollVoteListController also scopes by optionId / isAnswer, not only pollId. That part is covered by #3059, so "matches iOS" here is true for the poll id only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.v9has the same code; a port is to be decided separately.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.🤖 Generated with Claude Code
Summary by CodeRabbit