Skip to content

refactor: remove timesmearing#8226

Open
link2xt wants to merge 2 commits into
mainfrom
link2xt/remove-timesmearing
Open

refactor: remove timesmearing#8226
link2xt wants to merge 2 commits into
mainfrom
link2xt/remove-timesmearing

Conversation

@link2xt
Copy link
Copy Markdown
Collaborator

@link2xt link2xt commented May 8, 2026

One problem with removing it is that chat name or description may not be applied if it is done twice within the same second:

&& (chat_group_name_timestamp, grpname) < (group_name_timestamp, &chat.name)

Previously the sender increased the timestamp each time, so it was clear which update is the latest, but now the tests that rename the chat multiple times in a row break without sleep(1).

Also had to insert time shift in some "golden" tests because otherwise they become flaky if the messages are sent by different senders and are received not in the order in which they are sent. If the second is the same, they were ordered in reception order, if the second is different they were ordered by timestamp and in the sending order.

@link2xt link2xt force-pushed the link2xt/remove-timesmearing branch 8 times, most recently from 8379b9d to 4f919ce Compare May 9, 2026 08:34
@link2xt link2xt marked this pull request as ready for review May 9, 2026 15:54
@link2xt link2xt force-pushed the link2xt/remove-timesmearing branch from 4f919ce to 2b97913 Compare May 15, 2026 00:05
@link2xt link2xt force-pushed the link2xt/remove-timesmearing branch from 2b97913 to 5e61bba Compare May 15, 2026 01:50
@link2xt link2xt requested review from Hocuri, iequidoo and r10s May 15, 2026 01:53
Copy link
Copy Markdown
Collaborator

@iequidoo iequidoo left a comment

Choose a reason for hiding this comment

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

The problem with removing time smearing is that recently we started to sort messages almost purely by Date, so if messages having the same Date value (e.g. forwarded messages) are delivered reordered, they will be sorted wrongly. Maybe it makes sense to add some auto-incremented Chat-Message-Index header? Also this way, if a backup is transferred to a device with clock a bit in the past, messages sent from it will be ordered correctly.

EDIT: Probably it's better to be solved by ordering by References and In-Reply-To.

@r10s
Copy link
Copy Markdown
Contributor

r10s commented May 17, 2026

idea was to make things simpler, less discussions etc. assumption was to try to remove timesmearing as it might be superfluous today - it was initially introduced to force sorting in classic mua. that assumtion seems to be wrong.

timesmearing still seems to be needed.

surely things can be done differently. however, at this point, before adding new sorting criteria or sort using a tree of replies, add new complexity, new bugs, new work, new discussions: it may be better to keep timesmearing and call it a day. it is comparable few, tested code

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.

3 participants