-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(@aws-amplify/datastore): extra fields in selective sync selection set on API's from older CLI #10949
Merged
svidgen
merged 4 commits into
aws-amplify:main
from
svidgen:fix-selection-set-fks-isolated
Feb 15, 2023
Merged
fix(@aws-amplify/datastore): extra fields in selective sync selection set on API's from older CLI #10949
svidgen
merged 4 commits into
aws-amplify:main
from
svidgen:fix-selection-set-fks-isolated
Feb 15, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpilch
reviewed
Feb 9, 2023
david-mcafee
reviewed
Feb 9, 2023
4 tasks
svidgen
force-pushed
the
fix-selection-set-fks-isolated
branch
from
February 10, 2023 20:07
a7aed2f
to
215e8be
Compare
svidgen
requested review from
dpilch,
david-mcafee and
iartemiev
and removed request for
a team
February 10, 2023 20:13
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #10949 +/- ##
==========================================
+ Coverage 81.54% 81.57% +0.02%
==========================================
Files 198 198
Lines 19610 19609 -1
Branches 4237 4227 -10
==========================================
+ Hits 15991 15996 +5
+ Misses 3329 3323 -6
Partials 290 290
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
dpilch
approved these changes
Feb 13, 2023
iartemiev
approved these changes
Feb 15, 2023
4 tasks
This was referenced Sep 10, 2023
Closed
Closed
Closed
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
Fixes an issue where the selection set for selective sync expressions was incorrect for apps built with some older versions of the CLI. Related-model key fields were included in the selection set, but were not recognized by cloud storage. This issue was introduced in with the nested predicates feature, which added the implicitly created FK fields to the table metadata
fields
list so they could be seen by the predicate builder.This PR removes the logic that augments the
fields
list and add a newallFields
list. All pre-existing logic and components (prior to lazy loading/nested predicates) will revert to use only the explicitly definedfields
list. The predicates builder will then useallFields
.To support this, storage predicate construction is refactored slightly to avoid using the storage predicate (v1 predicate) builder. The old builder complains when a field fromallFields
shows up, even though the field exist. So, we are instead constructing an AST and transforming it.The resulting storage predicate can, at times, contain joins againstnull
orundefined
values. This happens when a relationship is optional. So, the IndexedDBAdapter was also updated to avoid attempting aindex.get()
on these values, which otherwise causes IndexedDB to throw a fit.(Refactors around storage predicate generation and related IndexedDB fixes were handled upstream.)
Issue #, if available
#10785
Description of how you validated changes
many-to-many
app with added selective syncs. That PR can be merged after this one.Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.