-
Notifications
You must be signed in to change notification settings - Fork 193
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(datastore): new enum to represent inferred and designated authType #3694
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## flutter-datastore-v2 #3694 +/- ##
========================================================
+ Coverage 68.46% 68.60% +0.14%
========================================================
Files 1078 1079 +1
Lines 37552 37550 -2
========================================================
+ Hits 25709 25761 +52
+ Misses 11843 11789 -54
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
for authType in authTypes { | ||
continuation.yield({ [weak self] in | ||
guard let self, let api = self.api else { | ||
throw APIError.operationError("Operation cancelled", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should improve this error message so it will be easier to match to this code if customers give us logs with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this is when captured self is no longer exist, probably cancelled by the operation queue. How about this:
The initial synchronization process can no longer be accessed or referred to
096b474
to
80411e2
Compare
80411e2
to
060b5f6
Compare
…LBehavior (#3666) * WIP * DataStore compiles without SDK dependency * refactor(datastore-v2): use api plugin with async sequences * change to use Publisher operators for auth type streams * add nondeterminsitc operation for better testability * fix unit test cases * fix broken unit test cases of AWSAPIPlugin * fix broken AWSDataStorePlugin unit test cases * fix OutgoingMutationQueue test case * remove unused methods * fix broken test cases of SyncMutationToCloudOperationTests * fix broken unit test cases of API and DataStore * resolve plugins build issues (#3654) * remove lock from SyncMutationToCloudOperation * remove test case of retryable for signOut error * resolve comments * fix(datastore): propagate remote mutationEvents to Hub for sync received (#3697) * rename the package to InternalAmplifyCredentials * rewrite NondeterminsticOperation constructor with makeStream * resolve broken test case after merging latest orgin/main * feat(amplify): make GraphQLOperationType extends from String (#3719) * refactor(datastore): new enum to represent inferred and designated authType (#3694) * refactor(datastore): new enum to represent inferred and designated auth type * resolve failed multi auth integ tests * resolve comments * fix(datastore): use error description to produce clearer error info (#3733) --------- Co-authored-by: Michael Law <[email protected]>
Issue #
Description
The
AWSAuthModeStrategy
determines how AppSync requests are executed. It may attempt multiple AWS authentication modes to complete the request, retrying the next mode in the sequence if the previous one encounters an unauthorized error.However, the auth mode sequence relies on
nil
element to determine the end of the sequence. Additionally, the AppSync request factory also uses the special valuenil
to determine whether to try the default authentication mode configured in theamplifyconfiguration
file.Using
nil
to mark the end of a sequence is part of Apple's standard library. In this PR, we introduced a new enum value 'inferred' to serve this purpose instead of relying onnil
.General Checklist
Given When Then
inline code documentation and are named accordinglytestThing_condition_expectation()
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.