ITADN

There is no sSubscribe method on redisClient object when using redis sentinel with node-redis

#3177Openbarisusakli 创建于 2026-02-09
Bug
B
barisusaklicommented
### Description Originally reported at https://github.com/socketio/socket.io-redis-adapter/issues/571. I was asked to create an issue here. redis@5.10.0 @socket.io/redis-adapter@8.3.0 When using `createSentinel` from https://github.com/redis/node-redis/blob/master/docs/sentinel.md, the returned redisClient object doesn't have `sSubsribe/send_command` methods which are used by socket.io-redis-adapter. Everything works if the redisClient is created with `createClient` which returns an object with `sSubscribe` method. ### Node.js Version v24.13.0 ### Redis Server Version 7.4.1 ### Node Redis Version 5.10.0 ### Platform Windows, redis running on ubuntu in WSL ### Logs ```bash TypeError: redisClient.send_command is not a function at /usr/src/app/node_modules/@socket.io/redis-adapter/dist/util.js:126:25 at new Promise (<anonymous>) at PUBSUB (/usr/src/app/node_modules/@socket.io/redis-adapter/dist/util.js:125:16) at RedisAdapter.serverCount (/usr/src/app/node_modules/@socket.io/redis-adapter/dist/index.js:677:34) at RedisAdapter.fetchSockets (/usr/src/app/node_modules/@socket.io/redis-adapter/dist/index.js:550:35) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Sockets.getUidsInRoom (/usr/src/app/src/socket.io/index.js:316:19) at async Promise.all (index 5) at async Messaging.loadRoom (/usr/src/app/src/messaging/rooms.js:535:84) at async chatsController.get (/usr/src/app/src/controllers/accounts/chats.js:59:15) ```
2 条评论