-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
need to be able to unregister event #122
Comments
Ah ok I'll look at this |
I tried an approach to fix this, pushed to master and a new version, does this fix it for you? |
that works. thanks! |
I'm actually running into the same issue with subscribeToChannels. |
Aha I can take a look at adding the same solution there |
this would be awesome :) |
I pushed the same thing for subscribe to channels to master, is this working for you? |
Jest is giving me this weird error:
Trying to investigate where that could come from. as a side note, I have added ln-service with : |
if I comment a line with any clue about what this could be? |
Is the issue that it is showing the error or is it still not exiting properly? |
I have another update to master that I think can deal with this issue, can you try that? |
Pushed the change to master, are there other subscription APIs that you think should follow suit? |
I have another similar issue with payViaRoutes. I'm doing somthing like this:
so that if the invoice is not settled quickly, the front end is not stuck forever. but if this goes the timeout path, jest doesn't like it, as if the promise never completed. I guess it's a similar issue as above? |
Which promise isn't completed? The payViaRoutes promise never returns at all? |
if the node receiving the payment hodl the invoice, and the timeout occurs, my understanding is payViaRoutes might have open handlers that will make jest complain |
Did you try canceling the hodl just after the timeout? |
I tried settleHodlInvoice after the timeout but have the same behavior |
Is it possible to introduce a delay on the test side before marking the test as complete? Do you have similar issues with |
I'll try both of those |
This call is different from the normal subscription calls because it is not a subscription on the LND side |
|
Neither has a real subscription to LND, both are simply waiting for a response from LND to continue Real subscriptions to LND can be canceled, requests just wait for a return value |
I'm using jest with subscribeToChainAddress
One of the issues I'm running into is that subscribeToChainAddress is creating a eventEmitter internally, and add some event listener to it.
Because those event listeners are ending up in the event queue, I'm not able to exist Jest properly, jest instead is timing out.
I believe one way that could deal with it is by returning this emitter (
ln-service/chain/subscribe_to_chain_address.js
Line 71 in 44b0d6b
subInternal.removeAllListeners()
could be launched once the tests has passed.The text was updated successfully, but these errors were encountered: