Automattic / Automattic/monk

App hang when using promises/async on connecting

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

Description

I'm using `NodeJS 8.11.3` with `Monk 6.0.6` and I have the next piece of code:

function monkConnect(url) {
return new Promise(resolve => {
resolve(monk(url));
});
}

await monkConnect("some valid url");

I have tried in so many ways to make this works( using the callback from `monk(url)`, making the function `async` and calling `await` on monk, and so many methods) and the code just freeze/hang and nothing happen and I don't know how to resolve it. Please some help.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue's promise-based connection snippet with NodeJS 8.11.3, Monk 6.0.6, and a valid MongoDB URL. Then trace Monk's connection and callback handling to determine why the process hangs; done means the connection completes or fails visibly without freezing, with a regression test or documented reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, node.js
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.