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

Detect update available on first stream connection. #653

Closed

Conversation

@awwx
Copy link
Contributor

@awwx awwx commented Jan 30, 2013

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.

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.
n1mmy added a commit that referenced this pull request Feb 1, 2013
…ition where the server restarts between when the client loads app.html and when it makes a DDP connection. Fixes #653. Thanks @awwx!
@n1mmy
Copy link
Member

@n1mmy n1mmy commented Feb 1, 2013

Fixed in 514bf73

@n1mmy n1mmy closed this Feb 1, 2013
@awwx awwx deleted the awwx:detect-update-avail-on-first-connection-2 branch Mar 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants