Add tests to check that account data is cleaned up after a session
closes.
Make `establishConnection` available to account tests.
Remove code duplication between `poll` (now called `simplePoll`) and
the async_multi `pollUntil`.
when the error callback only needs to print the exception.
Replace unsafe references to `err.stack` with
`err && err.stack || err`. This avoids throwing a secondary exception
if the original exception in `err` isn't an object (`throw(null)` and
`throw(undefined)` are legal in JavaScript), and also displays the
error object if the stack trace wasn't included.
Document `Meteor.onConnection` instead of `Meteor.server.onConnection`.
Condense sections about when there is a session reconnect into a
single {{note}}.
Document the `stop` handle returned by `onConnect`.
Document `this.session` in Meteor.methods section.
Poll instead of using Deps.autorun in server test.
When polling the client connection, tests don't have a chance to
disconnect before the stream client automatically reconnects, so add
an option to disable retries for testing.
Callers of `Meteor.bindEnvironment` often have the `onException`
argument print the exception stack trace. To allow for less code
duplication, let the argument be a string providing the context
(e.g. "connection closed callback"), and then on an exception print
the context and the exception stack trace.
`closeSessionsForTokens` doesn't need to clone `sessionsByLoginToken`
because `onClose` callbacks are deferred.
Simplify `closeTokensForUser` by using `_.pluck`.
of connections can be closed without waiting for the close callbacks
on one connection to return before closing the other connections.
Underscore internal Session field `_closeCallbacks`.
Update comment to explain the cause of the problem requiring the use
of `Meteor.bindEnvironment` with Meteor's public API.
This was a regression in 0.6.6 when we upgraded to a new unreleased
version of http-proxy which now requires an explicit option to set them.
See #1624.
Followup to 72d3e08067. Without this, the hash wouldn't change and the client
wouldn't reload if a file was renamed in a way that didn't change the order
of files (eg, preserving its name in alphabetical order).
This didn't used to be a problem, as the hash computation was only used in
appcached, which included the file path already and would change if the
file was renamed.
Remove the unused `serverRequestedVersion` argument to
`onDDPVersionNegotiationFailure`.
And let's call the remaining argument `description` instead of `error`
since it isn't an Error object.
be a strong dependency of appcache.
Delaying publishing the current client version document until the auto
update version is available isn't necessary because the publish
callback won't be called before webapp starts listening, and that
happens after startup.
In the app cache manifest include both the client hash and the
AUTOUPDATE_VERSION, which both allows the browser to load new
client code even when the auto update version is explicitly set by the
developer, and also ensures that if the developer changes the auto
update version this is propagated to the client in the app HTML so
that autoupdate doesn't get into an infinite loop of reloads.
so that developers still get hot code pushes when writing tests.
Fix livedata tests.
Add a sanity check to deciding when to reload: only reload if there is
an available client version marked "current". (Otherwise if the
server fails to publish any valid client versions, perhaps as a bug in
a forked autopublish package, the client will go into an infinite loop
of reloads).
Update QA notes.
on the default connection, on the assumption that new
client code will be able to negotiate successfully.
Uses an exponential backoff if after reload the DDP version
negotiation fails again.