Skip to content

Conversation

@JaCaLlaSchwarz
Copy link
Collaborator

@JaCaLlaSchwarz JaCaLlaSchwarz commented Jan 5, 2026

BugWPB-21925 [iOS] Conversation list isn't ordered based on latest messages after backup import

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

  1. Write any message in any conversation, BUT NOT the first.
  2. Get back to conversations lists, now the conversation where we wrote the message is at top.
  3. Do a backup (Adjustments/Account/Copy or restore/do not encrypt/Save in files)
  4. Logout
  5. Select staging environment.
  6. Login with provided credentials, OBSERVE that conversation order is not kept because conversation timestamp was set to login timestamp.
  7. Restore step 3 backup ((Adjustments/Account/Copy or restore/do not encrypt/Save in files)
  8. Get back at conversation list and check that top conversation is same as step 2.

Video:
https://github.com/user-attachments/assets/1ead3aef-cc2d-4cf2-9793-46c5bcdc5f25

Unit test

  • On PullAllConversationsSyncTests.testPull(), is assert(ed) that conversation timestamp is set to minimum, for enabling update conversation timestamp when messages timestamp are closer to now.
image

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

During restoring backup process, conversation timestamp is set with its latest message timestamp.
@JaCaLlaSchwarz JaCaLlaSchwarz self-assigned this Jan 5, 2026
@JaCaLlaSchwarz JaCaLlaSchwarz added the bug Something isn't working label Jan 5, 2026
@JaCaLlaSchwarz JaCaLlaSchwarz changed the title [Fix][WPB-21925]: conversation sorted after backup import. fix: conversation sorted after backup import. Jan 5, 2026
@David-Henner David-Henner changed the title fix: conversation sorted after backup import. fix: conversation sorted after backup import - WPB-21925 Jan 5, 2026
Copy link
Collaborator

@netbe netbe left a 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

@JaCaLlaSchwarz JaCaLlaSchwarz marked this pull request as ready for review January 12, 2026 10:32
@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

Test Results

    2 files    433 suites   2m 38s ⏱️
2 342 tests 2 315 ✅ 27 💤 0 ❌
2 343 runs  2 316 ✅ 27 💤 0 ❌

Results for commit d7ade63.

♻️ This comment has been updated with latest results.

samwyndham and others added 2 commits January 14, 2026 09:33
Copy link
Collaborator

@netbe netbe left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timestamp: Date.distantPast,
timestamp: conversation.lastEventTime ?? Date.distantPast,

Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure,

Copy link
Collaborator

@netbe netbe left a 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

@JaCaLlaSchwarz JaCaLlaSchwarz changed the base branch from develop to release/cycle-4.14 January 15, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants