cabal-club / cabal-club/cabal-cli
"/add abcd" crashes cabal-cli
- Dominant language
- JavaScript
- Stars
- 525
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
1. Launch Cabal and join the public chat
2. Navigate to the status channel
3. Type "/add abcd"
Result:
` (node:27347) UnhandledPromiseRejectionWarning: Error: dns failed to resolve
at /Users/joey/.nvm/versions/node/v12.14.1/lib/node_modules/cabal/node_modules/cabal-client/src/client.js:156:38
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:27347) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:27347) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`
If I'm reading the code correctly, the cli calls cabal-client:commands.js and runs cabal.client.addCabal. When that executes at https://github.com/cabal-club/cabal-client/blob/b23a45b7e2a96fea9820193ebbf0c2d1e37f77f0/src/client.js#L134 it doesn't call cabal-core's isHyperCoreKey https://github.com/cabal-club/cabal-core/blob/9a0f6e7395ed707d1f348b0049ce20f199cfcfe9/index.js#L224 to verify that what we are passing is a valid key (just a string). My guess is that this is so we can deal with aliases?
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the crash from the Cabal CLI status channel using `/add abcd`, then trace the call from cabal-client:commands.js into cabal-client/src/client.js around line 134. Compare the input validation in cabal-core/index.js around line 224, including the issue's concern about aliases. Done means the command no longer produces an unhandled rejection for this input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100