Skip to content

Conversation

iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Sep 7, 2025

Depends on #7116
This also improves performance of calc_sort_timestamp(). See commit messages.

@iequidoo iequidoo marked this pull request as draft September 7, 2025 11:23
@iequidoo iequidoo force-pushed the iequidoo/unbend-calc_sort_timestamp branch 2 times, most recently from a7ef844 to fe2e94c Compare September 8, 2025 05:47
@iequidoo iequidoo changed the base branch from iequidoo/test_sync_sentbox_then_inbox to main September 8, 2025 05:48
@iequidoo iequidoo force-pushed the iequidoo/unbend-calc_sort_timestamp branch from fe2e94c to 8c77e2a Compare September 8, 2025 06:21
…mestamp

This also simplifies the SQL query in `calc_sort_timestamp()` 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).

This as well fixes ordering of delayed encrypted outgoing messages; before, they could be sorted
above "Messages are end-to-end encrypted."

TODO: This breaks a couple of tests until removal of protected chats is merged.
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 force-pushed the iequidoo/unbend-calc_sort_timestamp branch from 8c77e2a to 295215c Compare September 8, 2025 08:35
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.

1 participant