Skip to content

Apply unpin partial updates and stamp participant message events with the current created_at - #52

Merged
andremion merged 2 commits into
mainfrom
fix/pin-event-timestamp-and-unpin
Jul 27, 2026
Merged

Apply unpin partial updates and stamp participant message events with the current created_at#52
andremion merged 2 commits into
mainfrom
fix/pin-event-timestamp-and-unpin

Conversation

@andremion

Copy link
Copy Markdown
Contributor

Goal

Two fixes needed by the upcoming Android pinned-message e2e tests (the first pin coverage on any platform).

  1. Unpin was silently dropped. The Android SDK unpins a message with a partial update set: {pinned: false}. The update handler branched on the value of set.pinned, which is falsy for false, so the unpin never applied and no message.updated event was sent.
  2. Participant message events carried a stale template timestamp. The /participant/message route never set the event-level created_at, so every event it broadcast kept the static date from the ws_events.json template. The Android client sorts each batch of near-simultaneous events by event created_at, so a participant pin (dated with the template's old date) was applied before the message.new echo of the message it pinned, and the pin was overwritten.

Related: AND-1328

Implementation

  • update_message branches on the presence of the pinned key instead of its value, so pinned: false is applied like pinned: true.
  • The /participant/message route stamps the event's created_at with the current timestamp, the same way create_event and create_reaction already 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.
  • Ran the new Android PinnedMessagesTests (4 tests: user pin, user unpin, participant pin, participant unpin) locally against this branch: all green. Against main, only user pin passes.
  • Regression: ran the Android ChannelListTests (12 tests) and ReactionsTests (10 tests) locally against this branch: all green. These cover the participant message and reaction flows affected by the timestamp change.
  • iOS is unaffected today: its e2e suite has no pin tests, and the timestamp fix only corrects the event date.

@andremion

andremion commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Started e2e tests on this branch:

@andremion
andremion requested a review from testableapple July 27, 2026 12:56
@andremion
andremion marked this pull request as ready for review July 27, 2026 14:46
@andremion
andremion enabled auto-merge (squash) July 27, 2026 14:52
@andremion
andremion merged commit 2d27c8d into main Jul 27, 2026
4 checks passed
@andremion
andremion deleted the fix/pin-event-timestamp-and-unpin branch July 27, 2026 15:21
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.

2 participants