-
Notifications
You must be signed in to change notification settings - Fork 24
fix: conversation sorted after backup import - WPB-21925 #4060
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: conversation sorted after backup import - WPB-21925 #4060
Conversation
During restoring backup process, conversation timestamp is set with its latest message timestamp.
netbe
left a comment
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.
left a question before approving
WireDomain/Sources/WireDomain/Synchronization/PullAllConversationsSync.swift
Outdated
Show resolved
Hide resolved
Test Results 2 files 433 suites 2m 38s ⏱️ Results for commit d7ade63. ♻️ This comment has been updated with latest results. |
Co-authored-by: Jullian Mercier <31648126+jullianm@users.noreply.github.com>
netbe
left a comment
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.
LGTM;)
…lable - WPB-22784 🍒 (#4115) Co-authored-by: Jullian Mercier <31648126+jullianm@users.noreply.github.com>
| await store.storeConversation( | ||
| conversation.toDomainModel(), | ||
| timestamp: .now, | ||
| timestamp: Date.distantPast, |
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.
| timestamp: Date.distantPast, | |
| timestamp: conversation.lastEventTime ?? Date.distantPast, |
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.
To be in line with Android, we should do this 👆
@JaCaLlaSchwarz you'd need to update the tests
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.
Sure,
netbe
left a comment
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.
should retarget 4.14
…-backup-import-WPB-21925
During restoring backup process, conversation timestamp is set with its latest message timestamp.
Issue
When user is logged in empty conversations are pulled from server and its .lastModifiedDate is set to login time, so all conversations are at the same timestamp. On recovering backup messages, no order can be set on adding messages to conversations because all message timestamps are earlier to login timestamp, so is not possible set an order in the conversations.
SOLUTION: On pulling conversations, timestamp is set to minimum (instead of current), and when messages are added to conversations conversation timestamp is set when message time is greater than conversation time, in that way most recent conversations are presented at the beginning of the list.
Testing
Pre: Select Staging environment and Login in with provided credentials
Video:
https://github.com/user-attachments/assets/1ead3aef-cc2d-4cf2-9793-46c5bcdc5f25
Unit test
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: