Skip to content

Conversation

@grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Feb 13, 2025

This pull request includes significant changes to the AuthClient class in Sources/Auth/AuthClient.swift to improve concurrency handling and integrate Combine for handling app lifecycle changes.

Concurrency improvements:

  • Changed AuthClient from a final class to an actor to leverage Swift's concurrency model.

To keep backward compatibility, had to mark a few properties and methods of AuthClient as nonisolated, the nonisolated mark, shall be removed on a next major release.

Combine integration:

Because of the change from class to actor, I had to change the way we observe the notification center.

  • Added Combine import conditionally based on availability.
  • Refactored observeAppLifecycleChanges to use Combine publishers for handling app lifecycle notifications.

These changes improve the concurrency model of AuthClient and modernize the handling of app lifecycle events using Combine.

@grdsdev grdsdev marked this pull request as ready for review February 13, 2025 18:28
@grdsdev grdsdev requested a review from dshukertjr February 13, 2025 18:28
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13312951371

Details

  • 46 of 62 (74.19%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.1%) to 74.38%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Sources/Auth/AuthClient.swift 46 62 74.19%
Files with Coverage Reduction New Missed Lines %
Sources/Auth/AuthClient.swift 2 88.5%
Totals Coverage Status
Change from base Build 13261463260: -0.1%
Covered Lines: 5011
Relevant Lines: 6737

💛 - Coveralls

@grdsdev grdsdev merged commit bdf1961 into main Feb 14, 2025
23 of 24 checks passed
@grdsdev grdsdev deleted the guilherme/fix-crash-auth branch February 14, 2025 10:24
grdsdev added a commit that referenced this pull request Feb 19, 2025
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.

4 participants