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

fix: #552 #553

Merged
merged 2 commits into from Mar 6, 2020
Merged

fix: #552 #553

merged 2 commits into from Mar 6, 2020

Conversation

julienroulle
Copy link
Contributor

Checklist

  • Use a separate branch in your local repo (not master).
  • Test coverage is 100% (or you have a story for why it's ok).

This a related to this issue

@nicolodavis nicolodavis merged commit a080ce3 into boardgameio:master Mar 6, 2020
@julienroulle julienroulle deleted the #552 branch March 6, 2020 14:03
delucis added a commit that referenced this pull request Oct 26, 2020
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
delucis added a commit that referenced this pull request Oct 26, 2020
* 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
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

Successfully merging this pull request may close these issues.

None yet

2 participants