-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ Deduplicate
fetch()
network requests
At the moment, if a client calls `doc.fetch()` with a fetch request already in progress, the client will send a second request, which probably isn't needed (or wanted). This change prevents duplicate requests from being sent when there's already an inflight fetch request, and adds a `force` option, which can be used to force a duplicate request to be sent. This is currently used internally for `_hardRollback()`, which forcibly unsets the `doc.version`, and therefore requires a separate `fetch()` call, since fetch requests are [handled differently][1] depending on the presence of `version`. [1]: https://github.com/share/sharedb/blob/21750e320f6865ee14620d6bf9610cb7ebc5f18e/lib/agent.js#L607
- Loading branch information
1 parent
21750e3
commit 8a1dbe5
Showing
3 changed files
with
46 additions
and
19 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