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.
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.