incompl/cloak — pull request #80 by jugglinmike (2014-05-17 21:52:06+00:00)
Title: Unset client ID when stopped

> When the client invokes `stop`, it is signalling an explicit intent to
> disconnect. Therefore, subsequent connections should not be considered
> 'resume' events, but complete 'begin' events in their own right.
>
> By unsetting the client ID, multiple `run` invocations each behave
> identically (each sending a new 'begin' event to the server), and the
> 'resume' event is reserved for only unexpected re-connections.

The current behavior is causing an error in my application because we are also using [the "resource" conviguration for Socket.io](https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO) to differentiate connections. When the user switches between connections, [the "resume" event triggered by the server is labeled as "invalid"](https://github.com/incompl/cloak/blob/5ac8450ccbef47eeed8752967151f4b3e4bd7c9c/src/server/cloak/index.js#L141-L144).