Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

fix(pubsub): callback from unsubscribe after stream ends #772

Merged
merged 1 commit into from
May 18, 2018

Conversation

alanshaw
Copy link
Contributor

This PR changes the unsubscribe logic to only callback on the last event we can listen for on a dropped connection.

This still does not guarantee that your topic won't appear when calling pubsub.ls in the callback to pubsub.unsubscribe - but only when talking to go-ipfs.

Adding an artificial timeout using setTimeout seems to provide enough time for go-ipfs to actually do the unsubscribe.

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
@ghost ghost assigned alanshaw May 17, 2018
@ghost ghost added the in progress label May 17, 2018
@alanshaw alanshaw changed the title fix: callback from unsubscribe after stream ends fix(pubsub): callback from unsubscribe after stream ends May 17, 2018
@daviddias
Copy link
Contributor

Now seems that a new fail on DHT is happening:

  1) .dht

       "before all" hook:

     Error: Uncaught AssertionError: expected [Error: Unexpected end of JSON input] to not exist (webpack:///node_modules/chai/lib/chai/assertion.js:141:0 <- node_modules/aegir/src/config/karma-webpack-bundle.js:93052)

@alanshaw alanshaw merged commit f4dca3e into master May 18, 2018
@ghost ghost removed the in progress label May 18, 2018
@alanshaw alanshaw deleted the fix/pubsub-unsub-cb2 branch May 18, 2018 08:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants