Skip to content
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

peer clocks don't reset when we change docIds #10

Open
choxi opened this issue Jun 28, 2017 · 1 comment
Open

peer clocks don't reset when we change docIds #10

choxi opened this issue Jun 28, 2017 · 1 comment

Comments

@choxi
Copy link
Collaborator

choxi commented Jun 28, 2017

If Alice and Bob both open up the same document, and then Alice creates a new document, Alice keeps Bob's vector clock in deltaRouter.clocks even though its for the wrong docId now. You can see this by reproducing these steps and inspecting app.store.deltaRouter.clocks in the Alice's web inspector before and after we change documents -- we should theoretically not have any vector clocks stored because Bob has never opened the document that Alice is on but instead we do still have his vector clock.

I'm not sure how this would manifest as a bug in Trellis, but it could be causing problems especially in conjunction with #9.

@pvh
Copy link
Member

pvh commented Jun 29, 2017

That's definitely wrong, but it works sometimes because when the other client changes docId they should send a new empty vector clock. Still, in many cases, it will get clockMax()'d against the other one and lead to problems. I think it probably works okay on a fork

When we change docId we should clear clocks[].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants