Skip to content

fix: Manipulate sort_timestamp to not be 0q#8055

Draft
Hocuri wants to merge 7 commits intolink2xt/no-sort-below-last-seenfrom
hoc/manipulate-e2eemsg-timestamp
Draft

fix: Manipulate sort_timestamp to not be 0q#8055
Hocuri wants to merge 7 commits intolink2xt/no-sort-below-last-seenfrom
hoc/manipulate-e2eemsg-timestamp

Conversation

@Hocuri
Copy link
Copy Markdown
Collaborator

@Hocuri Hocuri commented Mar 28, 2026

Alternative to deltachat/deltachat-android#4326.

Not sure if I like it; it seems kind of hacky (and would at least need a comment).

link2xt and others added 7 commits March 28, 2026 10:24
It is not clear now what this is testing.
Golden test shows messages ordered
incorrectly according to the timestamps,
they should be ordered the other way round.

Comment talks about fetching from mvbox and inbox
in paralell which is a rare case that
could have happened if one message is left in the inbox
and the other message is a chat message moved to mvbox.
We never download anything that is not moved to the target folder.

The test also resides in "verified chats" tests
which are all legacy tests we kept after
replacing the concept of verified/protected chats
with key contacts in 2.x.
We know which message was added from the return value
of receive_imf(). It may be that the first chat
in the chatlist is not the one where the message was received
if there is a pinned chat or if
just received message is old.
…ginning

We set timestamp of this info message to 0
to make it always appear in the beginning of the chat.
To avoid new chats being sorted to the end of the chatlist,
we ignore such 0 and use chat creation timestamp
when sorting the chatlist.
This is to avoid sorting incoming messages that
are slightly in the past above system messages
about SecureJoin. SecureJoin messages are
timed according to smeared timestamp,
so even in the local tests they are in the future
by a few seconds.
@Hocuri Hocuri marked this pull request as draft March 28, 2026 15:37
@link2xt
Copy link
Copy Markdown
Collaborator

link2xt commented Mar 28, 2026

I did something similar at 95a347e, need to test if it works.

The difference is that the message will still have the lowest timestamp even if new message arrives with lower timestamp than timestamp_sent.

@link2xt link2xt force-pushed the link2xt/no-sort-below-last-seen branch from 95a347e to 3671857 Compare March 28, 2026 18:39
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