Page MenuHomePhabricator

Voting removes votes by renamed users
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue:

  • Vote for a wish or focus area
  • Get your account renamed
  • Vote for the wish or area with another account

What happens?:
The vote by the renamed account gets removed.

What should have happened instead?:
The vote stays.

Other information:
Example: https://meta.wikimedia.org/w/index.php?title=Community_Wishlist/FA2/Votes&diff=prev&oldid=29801297


Derived Requirement

Ensure that votes on wishes or focus areas remain valid and persist even if the user who cast the vote later has their account renamed.

Votes associated with the user must remain recorded and visible after the username change and must not be removed or invalidated due to the rename.

Test Result - Beta|Prod

Status: ✅ PASS / ❓ Need More Info / ❌ FAIL
Environment: beta/enwiki
OS: macOS Tahoe 26.3
Browser: Chrome 145
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure a vote persists after the voting user’s account is renamed

  1. Log in to Wikipedia with User A.
  2. Navigate to a wish or focus area that allows voting.
  3. Cast a vote on the wish or focus area.
  4. Request or simulate an account rename for User A to User A (Renamed).
  5. After the rename is completed, navigate back to the same wish or focus area page.
  6. Observe the vote count and the voting record.
  7. ✅❓❌⬜ AC1: The vote cast before the rename remains present and counted after the account rename.

Test Case 2: Ensure a renamed user can still vote again using another account without removing the original vote

  1. Log in to Wikipedia with User A.
  2. Navigate to a wish or focus area page and cast a vote.
  3. Rename the account from User A to User A (Renamed).
  4. Log out and log in with User B.
  5. Navigate to the same wish or focus area page.
  6. Cast a vote using User B.
  7. Refresh the page and check the vote list and vote count.
  8. ✅❓❌⬜ AC2: Both votes remain recorded and the vote from the renamed account is not removed.

QA Results - Meta Beta

ACStatusDetails
1T412648#11704065
2T412648#11704065

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I'm assuming the problem with wish authors being renamed (as there was with W91, W105, W371) hasn't been fixed, given that proposer is still the username. I wonder why user IDs aren't being stored instead of usernames, for wishes and votes alike.

Still happening (note the removal of the votes at 2024-09-15T09:41:33.091Z, 2025-06-26T13:23:19.559Z, and 2025-07-02T17:57:40.216Z).

@mikez-WMF Can you reconsider the priority for this? Triaging this as "Low" effectively signals that you don't think votes matter.

Some related discussion is at T406194: InvalidArgumentException: Wishes must have a proposer!. User IDs are illegible for wikitext editors, but the Votes page specifically isn't really meant for manual editing even for those who prefer wikitext. Surely, at minimum, we should not be wiping out votes! So I think the easiest thing to do is start silently ignoring invalid usernames. I'll start with that. Switching to using IDs would indeed be better (for /Votes anyway), but it would require a migration script.

What would be perfect is a parser function to fetch the user ID. My naive impression is the existence of {{GENDER:}} implies such a parser function should be performant (gender and user IDs live in the same table), so maybe that could be added to Core. But save that for a different task.

Scratch that! We can accept both a username or userid parameter, and normalize to userid whenever there's an edit. This way things will temporarily be backwards-compatible. I suppose a migration script is the only way to go but at least with the initial patch, things will be identical to how they are now, and once a new vote is saved, the issue will be forever resolved for that entity.

Patch incoming!

Change #1247861 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CommunityRequests@master] Voting: store user IDs instead of usernames and prep for a migration

https://gerrit.wikimedia.org/r/1247861

Thanks for working on this! I've filed the related issue mentioned above as T418975.

Change #1247861 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Voting: store user IDs instead of usernames and prep for a migration

https://gerrit.wikimedia.org/r/1247861

@MusikAnimal I just have a quick question regarding AC1, just to make sure before I mark it as Resolved.

Test Result - Meta Beta

Status: ✅ PASS / ❓ Need More Info
OS: macOS Tahoe 26.3
Browser: Chrome 145
Device: MBA
Emulated Device: NA

Test Artifact(s):
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/FA7
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/FA1
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/W19
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/F46

Test Steps

Test Case 1: Ensure a vote persists after the voting user’s account is renamed

  1. Log in to Wikipedia with User A.
  2. Navigate to a wish or focus area that allows voting.
  3. Cast a vote on the wish or focus area.
  4. Request or simulate an account rename for User A to User A (Renamed).
  5. After the rename is completed, navigate back to the same wish or focus area page.
  6. Observe the vote count and the voting record.
  7. AC1: The vote cast before the rename remains present and counted after the account rename.

Were just saying the vote itself would stay but the rename will obviously update and not keep the old username, right?

Test Case 2: Ensure a renamed user can still vote again using another account without removing the original vote

  1. Log in to Wikipedia with User A.
  2. Navigate to a wish or focus area page and cast a vote.
  3. Rename the account from User A to User A (Renamed).
  4. Log out and log in with User B.
  5. Navigate to the same wish or focus area page.
  6. Cast a vote using User B.
  7. Refresh the page and check the vote list and vote count.
  8. AC2: Both votes remain recorded and the vote from the renamed account is not removed.

Wishes

2 users3 users
}}
GMikesell-WMF changed the task status from Open to In Progress.Mar 12 2026, 7:48 PM
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from QA to In Development on the Community-Tech (Sea Lion Squad) board.

Test Case 1: Ensure a vote persists after the voting user’s account is renamed

  1. Log in to Wikipedia with User A.
  2. Navigate to a wish or focus area that allows voting.
  3. Cast a vote on the wish or focus area.
  4. Request or simulate an account rename for User A to User A (Renamed).
  5. After the rename is completed, navigate back to the same wish or focus area page.
  6. Observe the vote count and the voting record.
  7. AC1: The vote cast before the rename remains present and counted after the account rename.

Were just saying the vote itself would stay but the rename will obviously update and not keep the old username, right?

Correct. You can see when editing the /Votes page manually, we now have userid parameters instead of username.

Got it, thanks! I will mark this task as Resolved. Thanks for all your work!

Rename FaUser ID
2026-03-23_12-52-24.png (750×1 px, 115 KB)
GMikesell-WMF updated the task description. (Show Details)

Are the votes that have been removed before the patch for this went live going to be restored?

Are the votes that have been removed before the patch for this went live going to be restored?

I used https://quarry.wmcloud.org/query/103849 to identify potentially lost votes, and have either restored them or updated them to use userid. That came out to just seven edits.

@MusikAnimal Thanks!

Shouldn't all existing username be replaced with userid, or wouldn't votes being lost continue to occur when a user who has voted for a wish gets renamed and no one votes for it in the meantime?

(Also when I looked at Community Wishlist/W469/Votes, the rendered timestamps were shifted by 5 hours from UTC, even though I use the default timezone. It fixed itself when I purged the cache. It looks like when someone edits /Votes without using the extension, their local time gets cached for everyone, which is potentially—unlikely to be frequent but still—a privacy issue.)