alexbosworth / lightning

Lightning client methods
MIT License
127 stars 33 forks source link

[Question] Is there any way to terminate a subscription for the client side? #79

Closed vindard closed 2 years ago

vindard commented 2 years ago

I'm working with the subscribeToInvoices method in some tests and am trying to figure out if there's a way to explicitly end the subscription when I'm done with using it.

alexbosworth commented 2 years ago

remove listeners

vindard commented 2 years ago

I thought so as well, but for some reason the code never enters this codepath and the subscription never terminates from my testing.

alexbosworth commented 2 years ago

ok i guess this should be added but isn't added

alexbosworth commented 2 years ago

should be addressed in 5.16.5

vindard commented 2 years ago

I'll test this tomorrow on our codebase to confirm

vindard commented 2 years ago

should be addressed in 5.16.5

The subscription was being canceled correctly now but the doUntil loop was still being left open. I added some code with one approach to addressing this that now works for our use-case.

PR: https://github.com/alexbosworth/lightning/pull/80

alexbosworth commented 2 years ago

Ah interesting ok

vindard commented 2 years ago

Closing this now, all sorted on our end. Thanks!