-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
localDocument.$.subscribe invoked twice for an atomic insert #2471
Comments
@de-robat Good investigation. I think you have found a bug and we should change that. As you have pointed out, doing |
Ty for the quick reply, i'll prepare a PR and verify the integrity by running the tests. |
Ok, unfortunaltey it not just a matter of removing the line. The tests will fail at:
So i have to postpone a PR as i have no clue about the architecture around it. :/ |
Can you make a PR with a test that reproduces the problem you have? I will then continue with the fix. |
Hi folks, I created a PR with the corresponding test. I observed also that using .$.subscribe on a localDocument
to
Thank you very much for your efforts! |
Ty @christbald and @pubkey , let me know if I can be of further assistance. |
I fixed this now. The handling of updateData is now similar to a non-local document. |
Hello, first of all kudos for this generally well thought of and nicely running software. This Issue is rather to be considered a question before opening a potential PR.
We recently run into a problem when upserting localDocuments. We have a line that reads as follows:
And this one gets invoked twice for a single upsert. I could pinpoint the issue to this part of the code:
https://github.com/pubkey/rxdb/blob/master/src/plugins/local-documents.ts#L195
which reads like this:
The two marked lines both invoke the observables listener. I do not understand if this is intended. To add some context, this basically leads for a react application of ours to invoke unnecessary (virtual) rendering cycles which we would like to avoid.
Thanks in advance!
The text was updated successfully, but these errors were encountered: