Add a test where clients are disconnected forcefully #201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This new test is just like the normal make a tunnel through the server with two js clients-test.
The only difference is: just after the tunnel is build and the clients are about to sign off happily, the server cuts the connection (by simply shutting down).
With the bug we isolated in #190, this leads the nodejs processes to exit immediately because of an uncaught throw in pull-stream drain.
To make these tests pass ssb-room-client needs to be patched here to have an extra done callback on the drain call.
Additionally we advise for pull-stream to have a better way of signaling the inability to handle the error then just throwing the error from the network without an indication who called drain without the optional 2nd callback. @staltz gave me this idea and I managed to find the culprit in room-observer.ts with it:
TODO: publish updated nodejs deps and update our package.json to use them.