Skip to content

QUIT()/quit() not working as documented (returning undefined vs 'OK') #2333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rafak opened this issue Nov 25, 2022 · 0 comments · Fixed by #2346
Closed

QUIT()/quit() not working as documented (returning undefined vs 'OK') #2333

rafak opened this issue Nov 25, 2022 · 0 comments · Fixed by #2346
Labels

Comments

@rafak
Copy link

rafak commented Nov 25, 2022

.QUIT()/.quit() documentation states that the value returned by the command is 'OK' which is probably assumed to be coming directly from redis as stated in Redis QUIT docs

when running the following code, quit returns undefined, not 'OK'
it is either a bug in the code or a bug in the docs.

Welcome to Node.js v16.15.1.
Type ".help" for more information.
> const {createClient} = require('redis')
undefined
> const opt = {socket: {host:'redis', port: 6379}}
undefined
> let R = createClient(opt)
undefined
> R.connect().then(console.log)
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 63,
  [Symbol(trigger_async_id_symbol)]: 53,
  [Symbol(destroyed)]: { destroyed: false }
}
> undefined
R.sendCommand(['CLIENT', 'LIST']).then(console.log)
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 80,
  [Symbol(trigger_async_id_symbol)]: 78,
  [Symbol(destroyed)]: { destroyed: false }
}
> id=5 addr=172.18.0.2:53058 laddr=172.18.0.3:6379 fd=8 name= age=10 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=40928 argv-mem=10 obl=0 oll=0 omem=0 tot-mem=61466 events=r cmd=client user=default redir=-1

R.quit().then(console.log)
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 103,
  [Symbol(trigger_async_id_symbol)]: 91,
  [Symbol(destroyed)]: { destroyed: false }
}
> undefined             <==================== this should be 'OK', not undefined

Environment:

  • Node.js Version: Node.js v16.15.1.
  • Redis Server Version: Redis version=6.2.6, bits=64
  • Node Redis Version: [email protected]
  • Platform: Debian GNU/Linux 10 (buster) (docker)
@rafak rafak added the Bug label Nov 25, 2022
leibale added a commit to leibale/node-redis that referenced this issue Dec 1, 2022
leibale added a commit that referenced this issue Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant