-
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): Fix dequeue bug caused by undefined head #6361
fix(@aws-amplify/datastore): Fix dequeue bug caused by undefined head #6361
Conversation
if (head !== undefined) { | ||
await storage.delete(head); | ||
} |
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.
@manueliglesias Your suggestion here sounds correct to me:
#6358 (comment)
Namely, head
becoming undefined
sounds like a symptom of an underlying queue problem. (We can discuss this in Discord/Slack if you'd like)
Granted, this PR short-circuits the bug, so I'm happy to accept this if the "correct" solution differs & is a bigger lift.
Codecov Report
@@ Coverage Diff @@
## main #6361 +/- ##
==========================================
- Coverage 73.31% 73.31% -0.01%
==========================================
Files 208 208
Lines 12922 12923 +1
Branches 2526 2527 +1
==========================================
Hits 9474 9474
- Misses 3257 3258 +1
Partials 191 191
Continue to review full report at Codecov.
|
Thanks for your contribution! Based on #6358 (comment) workaround, this PR address the symptom, but the root cause still needs to be addressed within the team. We have ongoing work that should address this (if it hasn't been already), since DataStore is in active development. 🙏 |
@ericclemmons Is there already a solution in sight? I still experience the issue in v.4.1.2. It's hard to throttle the updates everywhere, since in react or react-native my DataStore updates often are invoked through useEffect (which may fire a lot)... Thanks for your update! |
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 |
Issue #, if available:
#6358
Description of changes:
Attempting to delete an
undefined
head when dequeueing in outbox would cause DataStore to break and throw error (TypeError: undefined is not an object (evaluating 'Object.getPrototypeOf(model)')
).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.