question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reconnection logic / Empty `closedResolver`

See original GitHub issue

Hi!

I try to test some reconnection logic. So I’m basically doing something like this:

server.close({ code: 1001, reason: "Something went wrong!", wasClean: true });
await server.closed;
await server.connected;  // problematic...

But it seems that the connection is not “cleaned up” after a close. The closedResolver is doing nothing: closedResolver!: () => void;. So, the last line in my code seems to be always true (I think from the first “connection”), because the open event is not fired again. Is it possible to alter the closedResolver somehow? Or did I oversee something?

Great library, btw!

Best regards, Kersten

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
loxycommented, Aug 5, 2020

Oh sorry for the delay, Romain. I’ve circumnavigated the problem somehow. It is not ideal, but for the tests ok. Thank you for your patience!

0reactions
romgaincommented, Aug 4, 2020

I’ll close this for now, but feel free to reopen if you have any suggestions!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Implementing reconnection logic in a Java EE application - IBM
In practice, this method prevents many reconnect attempts. Note that exit conditions have been omitted from the example for clarity. private void setupResources ......
Read more >
c# - .NET SqlConnection class, connection pooling and ...
The database was "disconnected", then "reconnected". I notice that there is a "State" property on SqlConnection... is there an appropriate way to query...
Read more >
Does not work with React <= 16.8.6,about romgain/jest-websocket ...
Putting asynchronous logic inside ReactTestUtils.act(. ... Reconnection logic / Empty `closedResolver` HOT 14; server.error() removes the server from the ...
Read more >
Reconnection States and Events - Programmable Video - Twilio
An introduction to Programmable Video reconnection states and events, providing guidance and sample code to show how to use them in your applications....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found