Skip to content

Conversation

iequidoo
Copy link
Collaborator

This is separated from closed #7180 . Everything related to fixing #7308 is removed. "Messages are end-to-end encrypted." is reordered in test_outgoing_encrypted_msg(), but as there are corner cases anyway (see #7308 ), this isn't important and shouldn't block code simplifications. The current code is hard to maintain and slow, i.e. it looks at every message in the chat, this doesn't scale.

Tested on some random chat, the SQL query took 1.411202ms (vs 6.692714ms before) in median. Still looks a bit slow, but already better.

Even if we decide that we don't want to add one more index to the db, the first commit has value on its own. There's no issue reference because there's no new work, i just moved the useful part of the closed PR here.

link2xt and others added 12 commits September 12, 2025 15:10
This mechanism replaces `Chat-Verified` header.
New parameter `_verified=1` in `Autocrypt-Gossip`
header marks that the sender has the gossiped key
verified.

Using `_verified=1` instead of `_verified`
because it is less likely to cause troubles
with existing Autocrypt header parsers.
This is also how https://www.rfc-editor.org/rfc/rfc2045
defines parameter syntax.
Create unprotected group in test_create_protected_grp_multidev
The test is renamed accordingly.

SystemMessage::ChatE2ee is added in encrypted groups
regardless of whether they are protected or not.
Previously new encrypted unprotected groups
had no message saying that messages are end-to-end encrypted
at all.
…mp_sent

This makes `calc_sort_timestamp()` a continuous function of the message timestamp, simplifies the
SQL query and prepares for creation of a db index for it so that it's fast. Currently it doesn't
uses indexes effectively; if a chat has many messages, it's slow, i.e. O(n).
Tested on some random chat, the SQL query took 1.411202ms (vs 6.692714ms before) in median. Still
looks a bit slow, but already better.
@iequidoo iequidoo changed the base branch from main to link2xt/ykltkokxntvk October 15, 2025 05:46
@link2xt link2xt force-pushed the link2xt/ykltkokxntvk branch from 5051240 to f1121da Compare October 15, 2025 17:16
@link2xt link2xt force-pushed the iequidoo/unbend-calc_sort_timestamp branch from adff64f to 9b1782b Compare October 15, 2025 17:16
@link2xt link2xt force-pushed the link2xt/ykltkokxntvk branch from f1121da to f6c2ada Compare October 16, 2025 02:59
@link2xt link2xt force-pushed the iequidoo/unbend-calc_sort_timestamp branch from 9b1782b to ba25096 Compare October 16, 2025 02:59
@link2xt link2xt force-pushed the link2xt/ykltkokxntvk branch 2 times, most recently from a70866e to e60632e Compare October 16, 2025 23:06
@link2xt link2xt force-pushed the iequidoo/unbend-calc_sort_timestamp branch from ba25096 to 4443d59 Compare October 16, 2025 23:06
@link2xt link2xt force-pushed the link2xt/ykltkokxntvk branch from e60632e to 9abbe7a Compare October 16, 2025 23:17
@iequidoo iequidoo force-pushed the iequidoo/unbend-calc_sort_timestamp branch from 4443d59 to adff64f Compare October 18, 2025 00:11
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