-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fixes to the sort timestamp of messages #5094
Conversation
e030237
to
3703628
Compare
8bcc866
to
f1c8cd1
Compare
Rebased and added fix: Add forgotten checks for Config::VerifiedOneOnOneChats |
f1c8cd1
to
dade653
Compare
Any progress on trying to add a test? |
dade653
to
c982425
Compare
…() (#5088) Before in some places it was correctly calculated by passing the "sent" timestamp to `calc_sort_timestamp()`, but in other places just the system time was used. In some complex scenarios like #5088 (restoration of a backup made before a contact verification) it led to wrong sort timestamps of protection messages and also messages following by them. But to reduce number of args passed to functions needing to calculate the sort timestamp, add message timestamps to `struct MimeMessage` which is anyway passed everywhere.
…f a new message (#5088) Drafts mustn't affect sorting of any other messages, they aren't even displayed in the chat window. Also hidden messages mustn't affect sorting of usual messages. But let hidden messages sort together with protection messages because hidden messages also can be or not be verified, so let's preserve this information -- even it's not useful currently, it can be useful in the future versions.
c05d77f
to
4689437
Compare
There's the same problem as in Another option is to add a Python test, but as we have less control over sent and received messages there, we can't write a test just checking a protection message timestamp and need to write some more high-level test, probably repeating the original @gerryfrancis's scenario, but it would be more complex and cumbersome than other tests we have now. The solution i can imagine here is to mock the system clock for the Rust tests, then we can write any tests checking timestamps of messages w/o adding unnecessary sleep()s. |
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.
Nice stuff! Sad about the missing test, maybe we can add a way to mock the time at some point
See commit messages.
There's no test yet, verified by hand only. Need to come up with more simple scenario than in #5088.
Fixes #5088