sidorares / sidorares/node-mysql2

connection.ping() resolves with error rather than rejecting

Open
#735 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

When using promises, the connection.ping() function behaves in a very confusing and counter-intuitive way — it resolves to an error when the ping fails. Would it not be much better to reject when the ping fails?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the connection.ping() promise entry point and trace how a failed ping is handled. Check the existing promise-related tests or test entry points for connection.ping(), then add coverage showing that a failed ping rejects rather than resolves with an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, node.js, typescript
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.