Skip to content

fix: Prevent hidden events from disrupting timeline date separators and message grouping - #3093

Open
Yashh56 wants to merge 1 commit into
cinnyapp:devfrom
Yashh56:fix/dateSeparator
Open

fix: Prevent hidden events from disrupting timeline date separators and message grouping#3093
Yashh56 wants to merge 1 commit into
cinnyapp:devfrom
Yashh56:fix/dateSeparator

Conversation

@Yashh56

@Yashh56 Yashh56 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes an issue where the timeline would sometimes render multiple duplicate Date Separators on the same day. It also fixes a related visual issue where consecutive messages sent by the same user within a minute would fail to collapse (group together) and erroneously repeat the user's avatar.

The root cause was that hidden events (such as m.reaction or edits) were continually updating the prevEvent reference as they were processed. Because they are not rendered on screen, any date boundaries they crossed would leave the dayDivider state stuck as true for the next visible message. Furthermore, their presence between normal messages disrupted the sender matching in the collapsed grouping check.

Changes

  • Introduced prevRenderedEvent in RoomTimeline.tsx to strictly track the last visible event rendered in the timeline block.
  • Updated the dayDivider and collapsed logic to evaluate against prevRenderedEvent instead of prevEvent.
  • prevEvent is still maintained for other underlying logic, such as determining the read-receipt newDivider marker.

Close: #3071

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.

Date separators sometimes show up multiple times per day

1 participant