sidorares / sidorares/node-mysql2
connection.ping() resolves with error rather than rejecting
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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