Page MenuHomePhabricator

Invalid value "" for user parameter "user"
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

I am finding circumstances where, despite their being a valid username entered in the target input, submitting Special:Block leads to the error (returned by the API):

Invalid value "" for user parameter "user"

Inspecting the network traffic, the API request to create the block has a blank user parameter.

I also notice the Block log does not get populated.

I don't know if this makes any difference, but when I see this problem I looked in the Vue devtools in Chromium, in the "Components" tab the "<UserLookup>" component has the modelValue: null.

Steps to reproduce problem
  1. https://test.wikipedia.beta.wmflabs.org/wiki/Special:Block
  2. In the "Username..." input, type "Drwpb"
  3. In the dropdown menu that appears, select "Drwpb" (either with mouse or keyboard)
  4. Blur the input (click outside or tab)
  5. Place the cursor in the input again (the dropdown menu should be blue shaded)
  6. Delete some or all the input and retype it
  7. Set a duration
  8. Submit the form

Expected behaviour: Block is created successfully.
Observed behaviour: Invalid value "" for user parameter "user"

Environment

Browser: Firefox 128. Chromium 130.
Wiki(s): https://test.wikipedia.beta.wmflabs.org MediaWiki 1.44.0-alpha (2d06484) 12:44, 6 November 2024.

Screenshots

Derived Requirement

Ensure that the username parameter in the API request to create a block on Special:Block is correctly populated with the selected username, even after retyping it in the input field.


BDD

gherkin
Feature: Block User with Retyped Username on Special:Block Page

Scenario: Ensure the username parameter is correctly populated after retyping in the input field
  Given the user is on Special:Block page
  And the user enters a valid username in the "Username..." input field
  And selects the username from the dropdown menu
  When the user clears and retypes the username in the input field
  And submits the block request
  Then the block should be created successfully
  And no error should be displayed for an invalid user parameter

Test Result - Beta|Prod

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/testwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure username parameter is correctly populated after retyping

  1. Navigate to Special:Block on testwiki.
  2. In the "Username..." input field, type "Drwpb."
  3. From the dropdown menu, select "Drwpb" using the mouse or keyboard.
  4. Blur the input field by clicking outside or pressing Tab.
  5. Click back into the input field to re-focus, then delete some or all of the input.
  6. Retype the full username "Drwpb."
  7. Set a block duration.
  8. Submit the form.
  9. ✅❓❌⬜ AC1: Confirm that the block is created successfully without displaying the error, "Invalid value '' for user parameter 'user.'"
  10. ✅❓❌⬜ AC2: Verify that the Block log entry appears with the correct username "Drwpb."

QA Results - Testwiki

ACStatusDetails
1T379162#10319224
2T379162#10319224

Event Timeline

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

[mediawiki/core@master] SpecialBlock [Codex]: update target user on blur

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

Change #1089846 merged by jenkins-bot:

[mediawiki/core@master] SpecialBlock [Codex]: update target user on blur

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

@MusikAnimal I am no longer receiving invalid values and a block is created successfully as seen in the gif. I will move this to Done. Thanks for all your work!

Test Result - Testwiki

Status: ✅ PASS
Environment: Testwiki
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure username parameter is correctly populated after retyping

  1. Navigate to Special:Block on testwiki.
  2. In the "Username..." input field, type "Drwpb."
  3. From the dropdown menu, select "Drwpb" using the mouse or keyboard.
  4. Blur the input field by clicking outside or pressing Tab.
  5. Click back into the input field to re-focus, then delete some or all of the input.
  6. Retype the full username "Drwpb."
  7. Set a block duration.
  8. Submit the form.
  9. AC1: Confirm that the block is created successfully without displaying the error, "Invalid value '' for user parameter 'user.'"

2024-11-13_12-29-49.mp4.gif (1×938 px, 2 MB)

  1. AC2: Verify that the Block log entry appears with the correct username "Drwpb."

See AC1

GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.
GMikesell-WMF moved this task from QA to Done on the Community-Tech (Jackal (not a fox) Fox) board.