Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Detect update available on first stream connection. #653
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.