-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Readwrite transaction in liveQuery context #1831
Comments
@dfahlander still getting this consistently
|
You're right. I've found the reason and will release a new version today. |
reverted back to 3.2.4 for now. |
@franleng thanks! The new release 4.0.1-beta.5 should probably be a better as long as the querier only performs pure read queries only and does not have any side effects (like setting state of another component, mutating DOM etc). The same principle goes for 3.2.4, but the difference is that it will not complain when it happens. Let me know if you'd have a chance to try 4.0.1-beta.5 just to verify the problem goes away. If not, check whether your callback to liveQuery() may have side effects or write to the DB. If still any issue, I'd be happy to troubleshoot it. |
The error ReadOnly Error: "Readwrite transaction in liveQuery context" can happen in dexie v4.0.1-beta.1, v4.0.1-alpha.25, v4.0.1-alpha.24 and v4.0.1-alpha.23 even when the querier did not perform any 'rw' transaction at all if the observer of the liveQuery performs a 'rw' transaction in the next micro task after it has been triggered. The issue was reported on a nextjs application using dexie@4.x and was a result of react scheduling an useEffect that did an 'rw' transaction.
The text was updated successfully, but these errors were encountered: