Skip to content

Comments

fix: key rename not working#797

Merged
tidwall merged 1 commit intotidwall:masterfrom
majiayu000:fix-764-key-rename-not-working-1231-0156
Jan 28, 2026
Merged

fix: key rename not working#797
tidwall merged 1 commit intotidwall:masterfrom
majiayu000:fix-764-key-rename-not-working-1231-0156

Conversation

@majiayu000
Copy link
Contributor

Fixes #764

Changes

  • Distinguish between hooks and channels when checking RENAME restrictions
  • Return "key has channels set" error when channels are present (instead of incorrectly saying "key has hooks set")
  • Added errKeyHasChannelsSet error in token.go
  • Updated tests to verify correct error message

The RENAME command was incorrectly returning "key has hooks set" when
a channel (not a hook) was associated with the key. This fix:

- Adds a new error errKeyHasChannelsSet for channel-specific errors
- Updates RENAME logic to check for hooks and channels separately
- Returns the appropriate error message based on what's blocking the rename
- Updates tests to expect "key has channels set" when channels are present

Fixes tidwall#764

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
@tidwall tidwall merged commit 068e3b3 into tidwall:master Jan 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

key rename not working

2 participants