Skip to content

Conversation

VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Oct 13, 2025

🎯 Goal

The message.updated event doesn't always return the full poll object. In that case, we must fallback to the poll object in the original message, otherwise the poll data will be lost.
Resolves: https://linear.app/stream/issue/AND-841/bug-in-threads-and-polls-behavior-causing-disappearance-of-parent

🛠 Implementation details

  • Use the original Message.poll if the MessageUpdatedEvent.poll is missing

🎨 UI Changes

Before After
before.mp4
after.mp4

🧪 Testing

  1. Thread reply to a poll
  2. The poll (in the parent message) should not disappear

Copy link
Contributor

github-actions bot commented Oct 13, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.22 MB 3.22 MB 0.00 MB 🟢
stream-chat-android-offline 3.45 MB 3.45 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.54 MB 10.54 MB 0.00 MB 🟢
stream-chat-android-compose 12.76 MB 12.76 MB 0.00 MB 🟢

@VelikovPetar VelikovPetar requested a review from Copilot October 13, 2025 09:35
@VelikovPetar VelikovPetar marked this pull request as ready for review October 13, 2025 09:35
@VelikovPetar VelikovPetar requested a review from a team as a code owner October 13, 2025 09:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes an issue where poll data was being lost when handling message.updated events that don't include the complete poll object, ensuring poll state is preserved by falling back to the original message's poll data.

  • Added poll preservation logic to MessageUpdatedEvent handling in channel and thread logic
  • Enriched Thread.updateParent to maintain poll data when updated parent lacks poll information
  • Added comprehensive test coverage for poll preservation scenarios across different event handling contexts

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ThreadLogic.kt Added poll fallback logic to preserve original poll when message update event lacks poll data
ChannelLogic.kt Enhanced message update event handling to maintain poll state from original message
Thread.kt Updated updateParent function to preserve poll data when parent update doesn't include poll
ThreadLogicTest.kt Added test cases for poll and reaction preservation in message update events
WhenHandleEvent.kt Added tests for poll preservation in channel message update handling
ThreadExtensionsTests.kt Added comprehensive test coverage for thread parent update with poll scenarios
CHANGELOG.md Added entry documenting the poll state fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

andremion
andremion previously approved these changes Oct 16, 2025
@andremion andremion enabled auto-merge (squash) October 16, 2025 15:39
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
63.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@andremion andremion merged commit aa31083 into develop Oct 17, 2025
12 of 13 checks passed
@andremion andremion deleted the bug/fix-poll-data-lost-after-message-updated branch October 17, 2025 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants