Promisifying of fs may not be correct
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
The wrap function only deals with first two arguments of the original function's callback. This may not work properly for any function which give more than 2 args in their result callback like fs.read and fs.write. They produce 3 args in the result callbacks (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer)
https://github.com/bcoin-org/blgr/blob/master/lib/fs.js#L15
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading lib/fs.js at line 15, focusing on the wrap function and how it handles callbacks from fs.read and fs.write. Check the callback results those functions provide, then verify that the promisified versions preserve all returned values rather than only the first two; done means those calls expose the complete callback result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100