Detect update available on first stream connection. - #653
Closed
awwx wants to merge 1 commit into
Closed
Conversation
Give each app bundle a unique bundle_id. Sets server_id to process.env.SERVER_ID if set, or else the bundle_id. Delivers the server_id to the client in the app html (via Meteor runtime config), so stream_client can detect that an update is available on the first connection.
Contributor
|
Fixed in 514bf73 |
StorytellerCZ
pushed a commit
that referenced
this pull request
Sep 18, 2021
…5.3.0 Update semantic-release to the latest version 🚀
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Between flights in PHL :)
Meteor has a small race condition: it is possible (if rather unlikely) that in between delivering the app html and the browser making the first stream connection, the server might have reloaded its code. Since the stream client uses the first connection to get the server_id in the welcome message, it won't notice that it's running outdated code.
The race condition has greater impact when using an app cache. The browser will normally start up with cached code, which means that most of the time a returning user after a code update will be out of date at the time of the first stream connection.
This PR includes the server_id in the Meteor runtime config (which is included in the HTML delivered to the browser). The client is then able to detect that a code update is available on the first stream connection.