Skip to content

fix(user): clear caches when deleting user group - #4966

Open
Cynthia-0203 wants to merge 1 commit into
koderover:mainfrom
Cynthia-0203:fix/delete-user-group-cache
Open

fix(user): clear caches when deleting user group#4966
Cynthia-0203 wants to merge 1 commit into
koderover:mainfrom
Cynthia-0203:fix/delete-user-group-cache

Conversation

@Cynthia-0203

@Cynthia-0203 Cynthia-0203 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What this PR does / Why we need it:

Clear stale user-group and group-role caches when deleting a user group to prevent users from retaining outdated project permissions.

What is changed and how it works?

  • Query the user group members before deletion.
  • Delete the user group from the database.
  • Clear the gid_role_<group_id> cache.
  • Clear each member’s user_group_<uid> cache.
  • Perform delayed cache deletion after 2 seconds to prevent stale cache recreation.

Does this PR introduce a user-facing change?

  • API change
  • database schema change
  • upgrade assistant change
  • change in non-functional attributes such as efficiency or availability
  • fix of a previous issue

This change is Reviewable

Signed-off-by: Cynthia <chenchen@koderover.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant