Describe the bug

I've been playing with ACL trying to get a sense of how it works and noticed some weird parsing inconsistency. Output below

To reproduce

127.0.0.1:6379> ACL SETUSER windsor on allcommands ~com::royalendicott::windsor::* &com::royalendicott::windsor::* >windsor
(error) ERR Error in ACL SETUSER modifier '&com::royalendicott::windsor::*': Adding a pattern after the * pattern (or the 'allchannels' flag) is not valid and does not have any effect. Try 'resetchannels' to start with an empty list of channels
127.0.0.1:6379> ACL SETUSER windsor on allcommands ~com::royalendicott::windsor::* >windsor
OK
127.0.0.1:6379> ACL SETUSER windsor &com::royalendicott::windsor::*
(error) ERR Error in ACL SETUSER modifier '&com::royalendicott::windsor::*': Adding a pattern after the * pattern (or the 'allchannels' flag) is not valid and does not have any effect. Try 'resetchannels' to start with an empty list of channels
127.0.0.1:6379> ACL SETUSER windsor &com::royalendicott::windsor::*
(error) ERR Error in ACL SETUSER modifier '&com::royalendicott::windsor::*': Adding a pattern after the * pattern (or the 'allchannels' flag) is not valid and does not have any effect. Try 'resetchannels' to start with an empty list of channels
127.0.0.1:6379> ACL SETUSER windsor resetchannels
OK
127.0.0.1:6379> ACL SETUSER windsor &com::royalendicott::windsor::*
OK
127.0.0.1:6379>

Expected behavior

I expected the first form to work, but it appears to put things in some kind of weird state that requires me to reset the channel permissions.

Additional information

redis_version:6.2.1 redis_build_id:cfaa1431404ef25b

Comment From: huangzhw

Because acl channels are added 6.2. To ensure backward compatibility while upgrading Redis 6.0, channels are grants by default. You can change config acl-pubsub-default, like config set acl-pubsub-default resetchannels.

Comment From: slithernix

Appreciate the explanation!