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

Manager._state not updated after reconnect #293

Open
ClintHaerinck opened this issue Feb 7, 2020 · 2 comments
Open

Manager._state not updated after reconnect #293

ClintHaerinck opened this issue Feb 7, 2020 · 2 comments

Comments

@ClintHaerinck
Copy link
Contributor

When following events are emitted:

  • open
  • close
  • reconnect
    The connection _state parameter is still STATE.CLOSED from the close event.

This because when a reconnect event is emitted by the MongoClient, the Manager _state parameter isn't updated to STATE.OPEN.

@mathieudutour
Copy link
Collaborator

Ah good catch! Want to send a PR to fix it?

@ClintHaerinck
Copy link
Contributor Author

ClintHaerinck commented Feb 10, 2020

Here you are. But I don't know if it will be used for long, I read stuff about unified topology. When I enable the 'useUnifiedTopology' option, the events aren't working anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants