-
-
Notifications
You must be signed in to change notification settings - Fork 58
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 for conflicting cursor events #177
Fix for conflicting cursor events #177
Conversation
63f1fc1
into
Meteor-Community-Packages:master
Releasing in v1.8.7 |
@StorytellerCZ This needs to be reverted. The problem with this pull request is that @gabrielcazacu96 FYI, _hasDocChanged (collectionName, id, doc) {
const existingDoc = this.docHash[buildHashKey(collectionName, id)]
if (!existingDoc) { return true }
return Object.keys(doc).some(key => !isEqual(doc[key], existingDoc[key]))
} |
Sorry for the typo, you are right. I still think
|
Thank you for clarifying, @gabrielcazacu96. I have two concerns, however:
I have looked at the issue you mention at the top and I think the problem may very well have to do with mergebox, which only works on the top level fields only. Could it be that this is the reason changed is not triggered as you expect it? There are multiple examples of subscriptions not updating when an array is updated, like in this example. It may look like a small change, but it has a systemic impact. I suggest moving this to a separate branch while testing in staging/production. [UPDATE] |
…es#177 The discussion in Meteor-Community-Packages#177 suggests `changed` is not properly triggered in subscription. Tests were added to validate that this is indeed the case (answer: no). The changes in Meteor-Community-Packages#177 have been reverted. All tests have been modified to only use the sync minimongo API, for simplicity. README updated
@gabrielcazacu96 Please see #182. I have added several tests to check for the behaviour you are reporting, but so far I did not catch anything. I did my best to reproduce your original issue at cult-of-coders/grapher#481. If you think I missed something, feel free to add a test case that best describes the problem, and we'll take it from there. [UPDATE] |
I tried replicating the issue in the tests you've written but I'm having trouble replicating how the grapher package creates this kind of publication. Also, the grapher issue seems to be fixed by @redabourial's #179. (Tested without the change in #177). Thanks for taking the time to look into this. I think #177 can just be reverted since I was just fixing the symptoms but #179 seems to have fixed the central issue. |
Reversing #177 & additional tests
An attempt to fix conflicting cursor events in related to this grapher issue. Might break other things 🤷
This happens when the same document exists in the children of more than one parent cursor.
What happens:
added
gets triggered from one parent1.1
docHash
is updated with the new documentchanged
gets triggered from the other parent2.1
_shouldSendChanges
is false because the same document already exists indocHash
2.2
this.meteorSub.changed
is not calledThis is an issue because if
this.meteorSub.changed
is not called, the change is not sent through the DDP.