Skip to content

refactor: load sessions with async/await - WPB-17719 #3373

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

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from

Conversation

johnxnguyen
Copy link
Collaborator

@johnxnguyen johnxnguyen commented Jul 22, 2025

TaskWPB-17719 [iOS] Deterministically load the user session

Issue

In order to support multibackend we need to be able to load user sessions deterministically. One step to help achieve this is to make use of async/await when loading sessions. This PR removes the completion handler approach of loading sessions and replaces them with async/await.

Specifically:

  • Load the CoreDataStack using async/await
  • Load ZMUserSession via SessionManager with async/await
  • Load SharingSession and NotificationSession with async/await

Testing

Use the app as normal, switch accounts, receive push notifications, tap on push notifications to open the app, share messages from the share extension.


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.

@johnxnguyen johnxnguyen marked this pull request as ready for review July 23, 2025 14:03
# Conflicts:
#	wire-ios-sync-engine/Source/SessionManager/SessionManager.swift
#	wire-ios-sync-engine/Tests/Source/SessionManager/APIMigrationManagerTests.swift
Copy link
Contributor

github-actions bot commented Jul 23, 2025

Test Results

    6 files    815 suites   7m 42s ⏱️
5 955 tests 5 928 ✅ 27 💤 0 ❌
5 956 runs  5 929 ✅ 27 💤 0 ❌

Results for commit 9ac6c30.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@dmitrysimkin dmitrysimkin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jullianm jullianm left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

3 participants