-
Notifications
You must be signed in to change notification settings - Fork 199
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(datastore): wrap failures to result when applying remote update events #3187
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #3187 +/- ##
===========================================
- Coverage 80.06% 64.20% -15.87%
===========================================
Files 99 1068 +969
Lines 6487 36132 +29645
===========================================
+ Hits 5194 23198 +18004
- Misses 1293 12934 +11641
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 970 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Changes LGTM. Can we link to some passing integration tests workflows against this change?
Yeah, our datastore integration test failed randomly. It rarely succeed. https://github.com/aws-amplify/amplify-swift/actions/workflows/integ_test_datastore.yml |
* main: fix(logging): fix issue with logger namespace not being set (#3213) fix(datastore): wrap failures to result when applying remote update events (#3187) test(storage): update storage integration test with longer expiration duration (#3208) chore: finalize release 2.17.1 [skip ci] chore: release 2.17.1 [skip ci]
Issue #
#1903
Description
We apply remote update events in batch. The existing code converts all the update operations into
Future<Void, DataStoreError>
, and merge them into one stream. The problem arises when aFuture
completes with an error; it causes the entire stream to terminate as an error. This behavior is unintentional and results in some update operations being silently discarded.The solution here is simply change
Future<Void, DataStoreError>
toFuture<Result<Void, DataStoreError>, Never>
, which wraps the failure to a result type and makes the operation stream never fail.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.