-
-
Notifications
You must be signed in to change notification settings - Fork 109
fix: Make calc_sort_timestamp() a continuous function of message timestamp and improve its performance
#7180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Make calc_sort_timestamp() a continuous function of message timestamp and improve its performance
#7180
Conversation
a7ef844 to
fe2e94c
Compare
295215c to
f05e585
Compare
calc_sort_timestamp() a continuous function of message timestampcalc_sort_timestamp() a continuous function of message timestamp and improve its performance
f05e585 to
462985d
Compare
| Msg#13: info (Contact#Contact#Info): [email protected] invited you to join this group. | ||
|
|
||
| Waiting for the device of [email protected] to reply… [NOTICED][INFO] | ||
| Msg#15: info (Contact#Contact#Info): [email protected] replied, waiting for being added to the group… [NOTICED][INFO] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reply is already encrypted, so now the message order looks more correct as to me. If an old delayed message arrives, even if it's outgoing, e.g. from another device, it also will be sorted correctly
462985d to
7c44f7d
Compare
66bffdb to
0f94529
Compare
…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."
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.
0f94529 to
5051240
Compare
7c44f7d to
dce6e5d
Compare
|
So, which problem does this fix? If it fixes an issue, please open an issue for it and link to it. Or does it make something faster, if so, what? |
There's a PR description:
I don't think it's correct that encrypted messages can appear above "Messages are end-to-end encrypted." See
|
|
closing, see #7308 for reasoning |
Depends and based on #7116
Fix #7308