Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(local): Use shared local master with bots (#838)
* fix(local): Use shared local master with bots This returns a shared local master from the Local transport even when `bots` is passed in the options to `Local`. #553 changed this to avoid out-of-date bots persisting, but in the process broke scenarios where several clients should remain in sync on a single page (see #800). This implements a more careful check, returning a shared master as long as the `bots` options passed are *equal* to each other (via simple object equality). The reliance on object identity could still represent a confusing gotcha, so in the future it might be better to offer a more explicit API for getting a new clean transport. Moving the global map of master instances *inside* the function scope of `Local`, could do this — calling `Local` would always return a new transport layer that could be shared around — but would potentially break current usage where repeatedly calling `Local` would still connect to the same master. Fix #800
- Loading branch information
Showing
2 changed files
with
52 additions
and
11 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