redis / redis/node-redis

Error literal check in RedisClient.prototype.on_ready needs to be wider

Open
#1,547 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
17.6k
Forks
2k
Avg merge
2d 3h
Merged PRs (30d)
40

Description

Issue

Describe your issue here

Using node-redis with Geode Redis adapter. Server doesn't support INFO command and returns string error message. This error message is not literally the same as the one being checked for in RedisClient.prototype.on_info_cmd error handling code.

The following change will check for both messages, and library works in both standard and Geode cases.

--- a/index.js
+++ b/index.js
@@ -423,7 +423,7 @@ RedisClient.prototype.on_ready = function () {

RedisClient.prototype.on_info_cmd = function (err, res) {
if (err) {

  •    if (err.message === "ERR unknown command 'info'") {
    
  •    if (err.message.includes("unknown command")) {
           this.on_ready();
           return;
       }
    

Environment
  • Node.js Version: v11.15.0
  • Redis Version: Geode Redis Adapter
  • Platform: Ubuntu 18.04

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in index.js at RedisClient.prototype.on_info_cmd, where the issue identifies the literal error check. Compare the standard Redis and Geode Redis adapter error messages, then verify that both cases allow readiness handling to continue without changing other errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, databases
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.