-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repo: split RepoEvent::NewDoc into a request and new event
Context: the automerge-repo JS implementation supports a request workflow for syncing with a document we don't have. In this workflow the requesting peer sends a "request" message which is identical to the current sync message except tagged with a different message type. Responding peers can then either respond with a sync message or with an "unavailable" message, which allows the receiver to tell the difference between a document the other end doesn't have and a document the other end has but which is empty. Problem: in the repo loop we have no way of telling the difference between a request for a new document and announcing a document we have. This is because both situations are expressed using the RepoEvent::NewDoc event. Solution: split `NewDoc` into a `RequestDoc` and `NewDoc` event. This allows us to send request messages for `RequestDoc` and sync messages for `NewDoc`.
- Loading branch information
Showing
10 changed files
with
124 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.