Closed
Description
We have username/password defined in options, and some scripts defined for the subscriber, and it seems after the socket is disconnected, the reconnection always fails with the following error.
My guess is one of these failed,
Despite the intention of the error, it seems pretty bad design to assume a server limitation on the client side. We already had to workaround this by specifying the ignorePubSubMode for pings, but it seems even the lib itself had issues dealing with this. I would suggest a global option to disable this entirely.
Error: Cannot send commands in PubSub mode
at /test/node_modules/@node-redis/client/dist/lib/client/index.js:323:23
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 0)
at async RedisSocket.socketInitiator (/test/node_modules/@node-redis/client/dist/lib/client/index.js:332:13)
at async RedisSocket._RedisSocket_connect (/test/node_modules/@node-redis/client/dist/lib/client/socket.js:128:13)
at async Commander.connect (/test/node_modules/@node-redis/client/dist/lib/client/index.js:162:9)
Environment:
- Node.js Version: v16.14.2
- Redis Server Version: 6.2.5
- Node Redis Version: [email protected]
- Platform: Debian bullseye