Skip to content
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

Bug: When connecting multiple times there will be listeners stacking up each time #302

Open
2 tasks done
LucyEgan opened this issue Jul 5, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@LucyEgan
Copy link

LucyEgan commented Jul 5, 2024

Describe the bug

Each time .connect(....) is called there will be another disconnected, error listener from it doing .disconnect() on the previous connection.

image

I'm pretty sure its related to this in ws.ts disconnect(

await Promise.any([
  this.requireStatus(ConnectionStatus.Disconnected),
  this.requireStatus(ConnectionStatus.Error),
]);

Steps to reproduce

db.connect()
db.connect()
db.connect()
db.connect()
db.connect()

Willl product the above example

Expected behaviour

the number of disconnected and error listeners to be cleaned up once complete.

SurrealDB version

2.0.0-alpha.4 for linux on x86_64

SurrealDB.js version

1.0.0-beta.12

Contact Details

lucy.e@aspirecomps.co.uk

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@LucyEgan LucyEgan added the bug Something isn't working label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant