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

HTTP sync with multiple clients #6292

Closed
M-Tarasov opened this issue Aug 4, 2024 · 2 comments
Closed

HTTP sync with multiple clients #6292

M-Tarasov opened this issue Aug 4, 2024 · 2 comments
Labels

Comments

@M-Tarasov
Copy link

Hello, I need some clarification, how the HTTP sync described here could work with multiple clients.

Let suppose, we have 2 clients synced with remote db and go offline, then
0. initial state in all databases [{id: X, updateAt: 0}], the checkpoint would be (1, X).

  1. being still offline, the client 1 creates a new document {id: A, updatedAt: 1}.
  2. client 2 creates a new document {id: Y, updatedAt: 2} and syncs it with server and goes offline, so that server's state now is [{id: X, updatedAt:0}, {id: Y, updatedAt: 2}]. After sync, the last checkpoint for client 2 would be (2, Y).
  3. client 1 goes online and do sync, the server's state after that would be [{id: X, updatedAt:0}, {id: A, updatedAt:1}, {id: Y, updatedAt: 2}].
  4. client 2 goes online again, its checkpoint is still (2, Y).

The question is, how the document A finds its way to client 2? According to the server's pull logic from link above, updatedAt 2 > 1 is false, (updatedAt 2 == 1 && id A < Y) is also false. And so the document A will not be sent to the client 2.

@pubkey
Copy link
Owner

pubkey commented Aug 4, 2024

There are two checkpoints stored, a pull- and a push-checkpoint.

Copy link

stale bot commented Aug 11, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.

@stale stale bot added the stale label Aug 11, 2024
@pubkey pubkey closed this as completed Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants