-
Notifications
You must be signed in to change notification settings - Fork 303
Fix poll data overridden by message.updated
event
#5963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix poll data overridden by message.updated
event
#5963
Conversation
SDK Size Comparison 📏
|
There was a problem hiding this 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.
|
🎯 Goal
The
message.updated
event doesn't always return the fullpoll
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
Message.poll
if theMessageUpdatedEvent.poll
is missing🎨 UI Changes
before.mp4
after.mp4
🧪 Testing