-
Notifications
You must be signed in to change notification settings - Fork 606
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
Better debugging information for Diagnostic Errors #612
Comments
@esbenp Go for it! I'm a fan of helpful diagnostics :) |
Alright I will. I am not super familiar with everything but could you maybe elaborate on what is a common cause for this? Is it |
this sets the pending update flag: WatermelonDB/src/Model/index.js Line 110 in c99f4a3
and this resets it: WatermelonDB/src/Database/index.js Line 93 in ee81f5a
both happen synchronously when you correctly use this:
so to hit this bug, you either have to prepare and update and then NOT pass it to batch synchronously (that's a bug, and watermelon in dev mode sends warnings about this), or something crashed on this path. example:
record1 will be stuck with a pending update, because something else crashed before it got to the batch call |
This is super helpful information, thank you! I actually thought this was related to multiple clients editing/deleting the same thing and then crashing when syncing (this error appears when we sync in our app). Searching for this error gave me nothing, but I am thinking this would be extremely helpful as a "Common errors" in docs - what do you say? |
@esbenp yeah! that would be very helpful! |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
joining in on the issue. using these versions: we've also been encountering this same problem with several of our users. has there been any changes in the library that may cause this since this ticket was closed? what's even more troubling is that we were unable to reproduce it by ourselves... |
@bureyburey I'm also having this problem, and it doesn't seem to have anything related to using prepareUpdate, as I haven't found a single usage of this method in my entire codebase. |
im getting this error on delte |
I have a common database wrapper were I have applied a really simple fix for this. All I did is wrap my This does the trick for me for now. |
We are dealing with a lot of
Diagnostic error: Cannot update a record with pending updates
errors these days. It's extremely hard to debug because it happens of course on somebody's client somewhere and is entirely dependant on their local state.Would probably be easier to debug if table + ID was part of this error - maybe even properties. Something like
Diagnostic error: Cannot update a record with pending updates (table: documents, ID: 1234, pending_updates: title, body)
. Otherwise it's practically impossible to figure out what caused the errorWhat do you think? I could whip out a quick PR
The text was updated successfully, but these errors were encountered: