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): Multi-auth DataStore bindings #2012

Merged
merged 1 commit into from Aug 9, 2022

Conversation

dnys1
Copy link
Contributor

@dnys1 dnys1 commented Aug 6, 2022

Fixes multi-auth in DataStore when using Dart Auth. This requires implementing getCurrentUser on the native bridge. Since it's a synchronous method, we use a push-based approach to update a local cache on native to avoid blocking the main native thread which will cause deadlock.

Fixes multi-auth in DataStore when using Dart Auth. This requires implementing `getCurrentUser` on the native bridge. Since it's a synchronous method, we use a push-based approach to update a local cache on native to avoid blocking the main native thread which will cause deadlock.

commit-id:15cbc60b
@dnys1 dnys1 requested a review from a team as a code owner August 6, 2022 17:53
@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2022

Codecov Report

Merging #2012 (9a2ea06) into next (20602d5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             next    #2012   +/-   ##
=======================================
  Coverage   43.92%   43.92%           
=======================================
  Files         122      122           
  Lines        7549     7549           
=======================================
  Hits         3316     3316           
  Misses       4233     4233           
Flag Coverage Δ
android-unit-tests ∅ <ø> (∅)
flutter-unit-tests 26.64% <ø> (ø)
ios-unit-tests 89.08% <ø> (ø)

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

await updateCurrentUser(null);
}
Amplify.Hub.listen(HubChannel.Auth, (AuthHubEvent event) {
updateCurrentUser(event.payload);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any risk of race condition between the Native plugin trying to access the current user and this trying to update it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but the retry mechanisms in DS should make up for it

@dnys1 dnys1 merged commit b225ae7 into aws-amplify:next Aug 9, 2022
@dnys1 dnys1 deleted the fix/auth/next/ds-sync branch August 9, 2022 17:06
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

4 participants