Automattic / Automattic/monk

Manager._state not updated after reconnect

Open
#293 2 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
JavaScript
Stars
1.8k
Forks
180
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the Manager's handling of the open, close, and reconnect events emitted by MongoClient, focusing on where _state changes. Confirm the reconnect path leaves _state at STATE.OPEN after the event sequence, and add or run a test covering that sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.