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(datastore): Continue initial sync if atleast one model syncs successfully and other models fail due to Unauthorized API error #3224

Merged
merged 6 commits into from
Sep 27, 2023

Conversation

thisisabhash
Copy link
Member

@thisisabhash thisisabhash commented Sep 15, 2023

Issue #

3136

Description

Initial Sync should succeed if atleast one model sync succeeds. In this PR, additional checks are added to catch Unauthorized APIError received for some models during Initial sync and return success.

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.

@thisisabhash thisisabhash requested a review from a team as a code owner September 15, 2023 21:48
@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2023

Codecov Report

Merging #3224 (e535c7c) into main (9a05bdd) will decrease coverage by 0.01%.
Report is 18 commits behind head on main.
The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##             main    #3224      +/-   ##
==========================================
- Coverage   64.63%   64.62%   -0.01%     
==========================================
  Files        1091     1091              
  Lines       37071    37081      +10     
==========================================
+ Hits        23962    23965       +3     
- Misses      13109    13116       +7     
Flag Coverage Δ
API_plugin_unit_test 67.10% <ø> (ø)
AWSPluginsCore 69.55% <ø> (ø)
Amplify 47.91% <ø> (+0.06%) ⬆️
Analytics_plugin_unit_test 86.39% <ø> (ø)
Auth_plugin_unit_test 75.15% <ø> (-0.09%) ⬇️
CoreMLPredictions_plugin_unit_test 59.44% <ø> (ø)
DataStore_plugin_unit_test 80.05% <100.00%> (+0.01%) ⬆️
Geo_plugin_unit_test 54.06% <ø> (ø)
Logging_plugin_unit_test 63.18% <ø> (ø)
Predictions_plugin_unit_test 35.17% <ø> (ø)
PushNotifications_plugin_unit_test 69.69% <ø> (ø)
Storage_plugin_unit_test 54.10% <ø> (ø)
unit_tests 64.62% <100.00%> (-0.01%) ⬇️

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

Files Coverage Δ
...gin/Sync/InitialSync/InitialSyncOrchestrator.swift 83.43% <100.00%> (+1.08%) ⬆️

... and 11 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@thisisabhash thisisabhash temporarily deployed to Fortify September 25, 2023 19:03 — with GitHub Actions Inactive
@thisisabhash thisisabhash changed the title fix(datastore): Continue initial sync if atleast one model from schema succeeds fix(datastore): Continue initial sync atleast one model syncs successfully and other models fail due to Unauthorized API error Sep 25, 2023
@thisisabhash thisisabhash changed the title fix(datastore): Continue initial sync atleast one model syncs successfully and other models fail due to Unauthorized API error fix(datastore): Continue initial sync if atleast one model syncs successfully and other models fail due to Unauthorized API error Sep 25, 2023
@thisisabhash thisisabhash temporarily deployed to Fortify September 25, 2023 20:20 — with GitHub Actions Inactive
Package.resolved Outdated Show resolved Hide resolved
@thisisabhash thisisabhash temporarily deployed to Fortify September 26, 2023 17:08 — with GitHub Actions Inactive
@thisisabhash thisisabhash temporarily deployed to Fortify September 26, 2023 17:54 — with GitHub Actions Inactive
@thisisabhash thisisabhash temporarily deployed to Fortify September 26, 2023 19:33 — with GitHub Actions Inactive
@thisisabhash thisisabhash merged commit 7d9e3da into main Sep 27, 2023
76 checks passed
@thisisabhash thisisabhash deleted the fix/gh-3136 branch September 27, 2023 16:40
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