-
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
feat: update DataStore observe / observeQuery to return all fields in local update snapshot (#9556) #9617
Conversation
dcb5f56
to
94032fd
Compare
Codecov Report
@@ Coverage Diff @@
## main #9617 +/- ##
==========================================
+ Coverage 78.34% 78.76% +0.41%
==========================================
Files 250 250
Lines 18339 18354 +15
Branches 3955 3963 +8
==========================================
+ Hits 14368 14456 +88
+ Misses 3840 3767 -73
Partials 131 131
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
94032fd
to
ac6a9cf
Compare
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.
Looks good! Just a minor req'd change
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.
Can we add testing for this?
0f91c74
to
eb05c82
Compare
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.
Small nit and a small question that I think was answered offline. Just wanted to make sure we double check it real quick but otherwise lgtm!
@svidgen - sure! |
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.
LGTM 👍
Edit:
I need to re-review this as it might be having unintended effects in the fields sent to the mutation input
@manueliglesias this shouldn't affect that, as the updates are only being returned to the customer, but the mutation event sent to AppSync will only send updated fields |
Awesome! Thank you for confirming @david-mcafee 😄 |
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.
It works great! The only thing I'd like to see changed is creating two types instead of adding an optional field to the existing type. That way we don't leak that implementation detail.
… local update snapshot (#9556)
Co-authored-by: Jon Wire <iambipedal@gmail.com>
946571b
to
c3c569c
Compare
c3c569c
to
11d2856
Compare
…ate to datastore 'observe'
11d2856
to
8ebdb57
Compare
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.
This lgtm. Thanks for working on this
getModelSyncedStatus: (model: any) => false, | ||
|
||
// not important for this testing. but unsubscribe calls this. | ||
// so, it needs to exist. | ||
unsubscribeConnectivity: () => {}, |
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.
Nit: Doesn't seem like this is the case but if tests ever did need to update the mocks for these implementations, it seems more idiomatic to use jest.fn()
.
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.
LGTM!! 👍
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.
LGTM 👍🏻
Confirmed with @svidgen offline that it's alright to merge this. |
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
feat: update DataStore observe to return all fields in local update snapshot (#9556)
Description of changes
Issue #, if available
#9556
Description of how you validated changes
Manual testing with a sample app, running unit tests.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.