You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered several inexplicable issues when using NDK in my code and determined that they were caused by a broken connection lifecycle, that disconnects relays even if subscriptions to them are still active. Unless they are set in explicitRelayUrls .
I wrote a simple test case.
While the issue likely affects every platform, i suggest to try to run the test in a webpage in firefox, since it is easier to see it in this way.
Test that works as expected
Open the dev console, go into the network tab and look at the websocket events, you'll see the websocket stays connected forever
this is the same as the previous code, minus explicitRelayUrls.
Open the dev console, go into the network tab and look at the websocket events. You'll see that after a while the websocket disconnects with connection closed 1005 :
This is a very insidious bug, since ndk will reconnect as soon as an event is sent by the client.
In an application that exchanges events frequently with the relay, this issue could be mistaken with rate limiting, or a bad relay.
The text was updated successfully, but these errors were encountered:
I've encountered several inexplicable issues when using NDK in my code and determined that they were caused by a broken connection lifecycle, that disconnects relays even if subscriptions to them are still active. Unless they are set in
explicitRelayUrls
.I wrote a simple test case.
While the issue likely affects every platform, i suggest to try to run the test in a webpage in firefox, since it is easier to see it in this way.
Test that works as expected
Open the dev console, go into the network tab and look at the websocket events, you'll see the websocket stays connected forever
Test with the issue
this is the same as the previous code, minus

explicitRelayUrls
.Open the dev console, go into the network tab and look at the websocket events. You'll see that after a while the websocket disconnects with
connection closed 1005
:This is a very insidious bug, since ndk will reconnect as soon as an event is sent by the client.
In an application that exchanges events frequently with the relay, this issue could be mistaken with rate limiting, or a bad relay.
The text was updated successfully, but these errors were encountered: