Apply unpin partial updates and stamp participant message events with the current created_at - #52
Merged
Merged
Conversation
Contributor
Author
andremion
marked this pull request as ready for review
July 27, 2026 14:46
andremion
enabled auto-merge (squash)
July 27, 2026 14:52
testableapple
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Two fixes needed by the upcoming Android pinned-message e2e tests (the first pin coverage on any platform).
set: {pinned: false}. The update handler branched on the value ofset.pinned, which is falsy forfalse, so the unpin never applied and nomessage.updatedevent was sent./participant/messageroute never set the event-levelcreated_at, so every event it broadcast kept the static date from thews_events.jsontemplate. The Android client sorts each batch of near-simultaneous events by eventcreated_at, so a participant pin (dated with the template's old date) was applied before themessage.newecho of the message it pinned, and the pin was overwritten.Related: AND-1328
Implementation
update_messagebranches on the presence of thepinnedkey instead of its value, sopinned: falseis applied likepinned: true./participant/messageroute stamps the event'screated_atwith the current timestamp, the same waycreate_eventandcreate_reactionalready do. This affects all participant message events, not only pins, which matches the real backend: an event is dated when it happens.Testing
bundle exec rubocop: no offenses.PinnedMessagesTests(4 tests: user pin, user unpin, participant pin, participant unpin) locally against this branch: all green. Against main, only user pin passes.ChannelListTests(12 tests) andReactionsTests(10 tests) locally against this branch: all green. These cover the participant message and reaction flows affected by the timestamp change.