Skip to content

GH-1328 Fix name update handling.#1328

Open
vLuckyyy wants to merge 1 commit intomasterfrom
fix-change-of-username
Open

GH-1328 Fix name update handling.#1328
vLuckyyy wants to merge 1 commit intomasterfrom
fix-change-of-username

Conversation

@vLuckyyy
Copy link
Member

@vLuckyyy vLuckyyy commented Mar 25, 2026

Already tested on production.

@vLuckyyy vLuckyyy requested a review from a team as a code owner March 25, 2026 13:16
@vLuckyyy vLuckyyy changed the title fix name update handling. GH-1328 Fix name update handling. Mar 25, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the UserManager to ensure correct handling of user name updates. The updateNameIfChanged method now returns an updated User object (a new instance if the name changed) and correctly manages the usersByName map by removing old name mappings, which improves consistency across cached and persisted user data. However, the current implementation of updateNameIfChanged introduces a critical race condition that can lead to data corruption if multiple threads concurrently update the same user's name. It is recommended to implement a synchronized block or a per-user locking mechanism to ensure thread safety.

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.

1 participant