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(@aws-amplify/datastore): extra fields in selective sync selection set on API's from older CLI #10929

Closed

Conversation

svidgen
Copy link
Member

@svidgen svidgen commented Feb 6, 2023

Description of changes

Fixes an issue where the selection for selective sync expressions was incorrect for apps build 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 new allFields list. All pre-existing (prior to lazy loading/nested predicates) will revert to use only the explicitly defined fields list. The predicates builder will use allFields.

Issue #, if available

#10785

Description of how you validated changes

  1. Added testing.
  2. Pending. Manual sample apps validation.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@svidgen svidgen force-pushed the fix-selective-sync-selection-set branch from c1b3a7f to 4a7bdd5 Compare February 7, 2023 15:34
@codecov-commenter
Copy link

Codecov Report

Merging #10929 (283cb3b) into main (c18876a) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

📣 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   #10929      +/-   ##
==========================================
- Coverage   81.48%   81.48%   -0.01%     
==========================================
  Files         198      198              
  Lines       19692    19691       -1     
  Branches     4249     4248       -1     
==========================================
- Hits        16047    16046       -1     
  Misses       3354     3354              
  Partials      291      291              
Impacted Files Coverage Δ
packages/datastore/src/storage/relationship.ts 93.67% <ø> (ø)
packages/datastore/src/types.ts 86.47% <ø> (ø)
packages/datastore/src/datastore/datastore.ts 88.43% <100.00%> (-0.02%) ⬇️
packages/datastore/src/predicates/next.ts 90.37% <100.00%> (ø)

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

@svidgen
Copy link
Member Author

svidgen commented Feb 17, 2023

Addressed in #10949

@svidgen svidgen closed this Feb 17, 2023
@svidgen svidgen deleted the fix-selective-sync-selection-set branch February 17, 2023 20:34
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.

2 participants