Skip to content
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

refactor: Modernize SDK to use async await for storage access #62

Merged
merged 81 commits into from
Mar 7, 2023

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Feb 28, 2023

New Pull Request Checklist

Issue Description

Synchronous calls can cause networking and storage issues. Though previous versions handle these pretty well, issues can happen such as #37 and #46

Approach

Breaking changes... Remove synchronous storage and networking calls. See updated Playgrounds files for more examples.

Examples:

// Old - synchronous
guard let user = User.current else {
  // Returns if User currently isn't logged in
  return
}
print(user)

// New - async/await
do {
  let user = try await User.current()
  print(user)
} catch {
  // Throws if User currently isn't logged in
}

TODOs before merging

  • Add tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@cbaker6 cbaker6 marked this pull request as ready for review March 7, 2023 03:11
@cbaker6
Copy link
Member Author

cbaker6 commented Mar 7, 2023

@bcbeta this PR should addresses crashes due to threading as the Keychain and Local storage are now actors and are now thread safe.

The PR will will be released in 5.0.0 later this week.

Note that this is a major breaking change and will require updating code to use.

@cbaker6 cbaker6 merged commit 2410ff6 into main Mar 7, 2023
@cbaker6 cbaker6 deleted the bumpMinSwift branch March 7, 2023 03:55
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.

None yet

1 participant