…before connection causes _RedisCommandsQueue_pubSubState in node-redis 4.x to get set resulting in 'AuthError: Cannot send commands in PubSub mode' error.
When a password is set on the redis server the following error is thrown by node-redis 4.x:
AuthError: Cannot send commands in PubSub mode
This happens because there is an internal state(_RedisCommandsQueue_pubSubState) in node-redis that gets set when the redis client .subscribe() method is called that will cause a subsequent call to the client .connect() method to fail with the aforementioned AuthError. I don't know if this is really an issue with node-redis or if it's user error but performing .subscribe() post .connect() in the ready Promise of feathers-sync gets around the issue.
…before connection causes _RedisCommandsQueue_pubSubState in node-redis 4.x to get set resulting in 'AuthError: Cannot send commands in PubSub mode' error.
Summary
This is a fix for https://github.com/feathersjs-ecosystem/feathers-sync/issues/178
When a password is set on the redis server the following error is thrown by node-redis 4.x: AuthError: Cannot send commands in PubSub mode
This happens because there is an internal state(_RedisCommandsQueue_pubSubState) in node-redis that gets set when the redis client .subscribe() method is called that will cause a subsequent call to the client .connect() method to fail with the aforementioned AuthError. I don't know if this is really an issue with node-redis or if it's user error but performing .subscribe() post .connect() in the ready Promise of feathers-sync gets around the issue.