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

fix(Auth): Fix multiple continuation resumes in hostedUI #3466

Merged
merged 6 commits into from
Jan 15, 2024

Conversation

harsh62
Copy link
Member

@harsh62 harsh62 commented Jan 11, 2024

Issue #

#3362

Description

The PR is aimed at using weak references in the completion blocks of continuations to avoid any retain cycles and at the same time also use the canStart API available in ASWebAuthentication to only start if its possible.

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@harsh62 harsh62 force-pushed the fix/continuation-crash-hosted-ui branch from b81c3b8 to 3b4da32 Compare January 11, 2024 17:21
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (003e1f3) 68.06% compared to head (4749750) 68.12%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3466      +/-   ##
==========================================
+ Coverage   68.06%   68.12%   +0.06%     
==========================================
  Files        1079     1016      -63     
  Lines       36356    34454    -1902     
==========================================
- Hits        24746    23473    -1273     
+ Misses      11610    10981     -629     
Flag Coverage Δ
API_plugin_unit_test 67.07% <ø> (ø)
AWSPluginsCore ?
Amplify 48.12% <ø> (+0.01%) ⬆️
Analytics_plugin_unit_test 81.16% <ø> (ø)
Auth_plugin_unit_test 79.00% <100.00%> (+0.01%) ⬆️
CoreMLPredictions_plugin_unit_test 59.44% <ø> (ø)
DataStore_plugin_unit_test 80.47% <ø> (-0.86%) ⬇️
Geo_plugin_unit_test 70.75% <ø> (ø)
Logging_plugin_unit_test 63.34% <ø> (ø)
Predictions_plugin_unit_test 37.16% <ø> (ø)
PushNotifications_plugin_unit_test 87.13% <ø> (ø)
Storage_plugin_unit_test 77.51% <ø> (ø)
unit_tests 68.12% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@harsh62 harsh62 marked this pull request as ready for review January 11, 2024 20:24
@harsh62 harsh62 requested a review from a team as a code owner January 11, 2024 20:24
lawmicha
lawmicha previously approved these changes Jan 11, 2024
(continuation: CheckedContinuation<[URLQueryItem], Error>) in
guard let self = self else { return }
Copy link
Contributor

Choose a reason for hiding this comment

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

here and below

Suggested change
guard let self = self else { return }
guard let self else { return }

@harsh62 harsh62 merged commit a961c64 into main Jan 15, 2024
78 checks passed
@harsh62 harsh62 deleted the fix/continuation-crash-hosted-ui branch January 15, 2024 16:19
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