redis-io icon indicating copy to clipboard operation
redis-io copied to clipboard

Bug when specifing "multiple" to a complex command

Open yoav-steinberg opened this issue 3 years ago • 6 comments

This pr: https://github.com/redis/redis-doc/pull/1645 Caused the GET subcommand to replicate each time the BITFIELD_RO page was refreshed. See attached image.

Screenshot from 2021-09-13 10-32-29

yoav-steinberg avatar Sep 13 '21 07:09 yoav-steinberg

I think the issue happens when you have a complex subcommand which has more than one argument but can appear multiple time. Relevant commands are BITFIELD and BITFIELD_RO. If there are others please add them to this ticket. Once this is fixed we'll update commands.json accordingly.

yoav-steinberg avatar Sep 13 '21 07:09 yoav-steinberg

I test in help.h, it is key GET type offset [GET type offset ...].

huangzhw avatar Sep 13 '21 11:09 huangzhw

I test in help.h, it is key GET type offset [GET type offset ...].

Yes, that's the correct usage of the command but for some reason when specifying "multiple":true in commands.json and we refresh the command's page a few times we get the above issue.

yoav-steinberg avatar Sep 14 '21 07:09 yoav-steinberg

After multiple refreshes, I could not reproduce :/

itamarhaber avatar Sep 21 '21 13:09 itamarhaber

Recreates for me (chromium and firefox). Apply following patch, run the site and go to: http://localhost:9292/commands/bitfield_ro

diff --git a/commands.json b/commands.json
index 4f40282..4fb49e0 100644
--- a/commands.json
+++ b/commands.json
@@ -278,7 +278,8 @@
         "type": [
           "type",
           "integer"
-        ]
+        ],
+       "multiple": true
       }
     ],
     "since": "6.2.0",

yoav-steinberg avatar Sep 22 '21 07:09 yoav-steinberg

Ok, I see it, confirmed :)

itamarhaber avatar Sep 22 '21 10:09 itamarhaber