redis / redis-io

Application running http://redis.io
http://redis.io
637 stars 176 forks source link

Bug when specifing "multiple" to a complex command #251

Open yoav-steinberg opened 3 years ago

yoav-steinberg commented 3 years ago

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 commented 3 years ago

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.

huangzhw commented 3 years ago

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

yoav-steinberg commented 3 years ago

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.

itamarhaber commented 2 years ago

After multiple refreshes, I could not reproduce :/

yoav-steinberg commented 2 years ago

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",
itamarhaber commented 2 years ago

Ok, I see it, confirmed :)