Skip to content

[ISSUE #2463] fix(auth): make status updates idempotent - #2467

Open
yuluo-yx wants to merge 1 commit into
apache:rocketmq-studiofrom
yuluo-yx:0820-yuluo-yx/fix-13
Open

[ISSUE #2463] fix(auth): make status updates idempotent#2467
yuluo-yx wants to merge 1 commit into
apache:rocketmq-studiofrom
yuluo-yx:0820-yuluo-yx/fix-13

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

  • return early when a requested enabled state already matches storage
  • avoid last-admin validation for disabled-admin no-op updates
  • skip database writes and session revocation for no-op requests

Verification

  • AuthServiceDatabaseTest: 9 tests passed
  • Checkstyle passed with 0 violations
  • scope check: 16 changed lines

Fixes #2463

Signed-off-by: yuluo-yx <yuluo08290126@gmail.com>

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Makes user status updates idempotent by returning early when the user is already in the desired state, avoiding unnecessary database writes and session invalidations.

Strengths:

  • Prevents redundant database operations
  • Avoids unnecessary session invalidation when status is unchanged
  • Test verifies the idempotent behavior with proper mock verification
  • Maintains existing safety checks (last admin protection)

LGTM — improves API efficiency and predictability.


Automated review by github-manager-bot

@RockteMQ-AI

Copy link
Copy Markdown

⚠️ Merge conflict detected

This PR has conflicts with the base branch and cannot be merged. Please rebase or merge the base branch into your branch and resolve the conflicts:

git fetch origin
git checkout 0820-yuluo-yx/fix-13
git rebase origin/rocketmq-studio
# resolve conflicts, then:
git push --force-with-lease

This is a one-time reminder. Feel free to @mention me for a re-review after conflicts are resolved.


Automated notification by github-manager-bot

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.

2 participants