Skip to content

fix date line being off by 1 message - #552

Merged
boxdot merged 2 commits into
boxdot:mainfrom
khyperia:date-line-fix
Jul 11, 2026
Merged

fix date line being off by 1 message#552
boxdot merged 2 commits into
boxdot:mainfrom
khyperia:date-line-fix

Conversation

@khyperia

Copy link
Copy Markdown
Contributor

fixes #536

consider the following three messages:

  • [sent on day 1] message A
  • [sent on day 1] message B
  • [sent on day 2] message C

the previous code iterated messages in reverse order (i.e. C, then B, then A). Upon encountering message B, previous_msg_day is day 2, from message C - so display_date_line would trigger and return Some("=== day 2 ===") (the day of the previous_msg_day). display_message would then put === day 2 === at the TOP of message B (not the bottom!). This caused message B to be in the "wrong day".

There's two ways to fix this: put === day 2 === at the bottom of message B, or, detect that we need a date line while processing message C (not B), and continue putting the date line at the top of the message. This PR does the latter. This also has the (intended) side effect of the first message ever sent in a channel now has a date line, it previously did not.


thanks for making/working on gurk, it's so hecking nice to be able to use signal on a desktop without using electron! ❤️

@boxdot boxdot left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for the fix!

@boxdot
boxdot merged commit 046e31e into boxdot:main Jul 11, 2026
10 checks passed
@khyperia
khyperia deleted the date-line-fix branch July 18, 2026 08:24
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 rolls over at the wrong time

2 participants