Page MenuHomePhabricator

Do all validations possible before generating a new entity ID
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
MusikAnimal
Sep 9 2025, 4:15 PM
Referenced Files
F66701615: PipeSubmit2.webm
Sep 26 2025, 5:27 PM
F66698863: PipeSubmit.webm
Sep 25 2025, 8:40 PM
F66698856: 2025-09-25_13-33-14.mp4.gif
Sep 25 2025, 8:40 PM
F66698842: 2025-09-25_13-29-15.mp4
Sep 25 2025, 8:40 PM
F66290484: 2025-09-22_16-28-21.mp4.gif
Sep 23 2025, 2:59 PM
F66290790: 2025-09-22_16-31-55.mp4.gif
Sep 23 2025, 2:59 PM
F66290541: 2025-09-22_16-27-15.mp4.gif
Sep 23 2025, 2:59 PM
F66290687: 2025-09-22_16-28-54.mp4.gif
Sep 23 2025, 2:59 PM

Description

Steps to replicate the issue (include links if applicable):

  • Make note of what the latest wish entity ID is, i.e. if the last wish was W5 then we expect W6 to be created next
  • Go to Special:WishlistIntake and fill out the form normally, but put a stray pipe character in the description |
  • Save, and observe the error, and keep trying to save again a bunch of times (for demonstration purposes)
  • After so many tries, remove the stray pipe character and save once more

What happens?:

The wish gets an ID a lot higher than what we would have expected.

What should have happened instead?:

If say W1 and W2 exist, the new wish should be W3, not something higher than that.

Other information (browser name/version, screenshots, etc.):

Discovered while writing documentation, and it seems to be confirmed looking at Beta. I.e. FA4 does not exist, nor did it ever exist, but FA6 does.

We do not need complete perfection here (it will still be possible for entity saves to fail and an ID is forever skipped), rather the point is to simply move validations to be before ID generation.


Derived Requirement

When creating a new wish on Special\:WishlistIntake, all form validations (including invalid characters, length checks, etc.) must be executed before generating a new entity ID.

  • Entity IDs should only increment when the submission passes validation.
  • Invalid submissions must not consume or skip entity IDs.
  • The sequence of IDs should remain continuous, except in rare cases of unexpected save failures.
Test Steps

Test Case 1: Normal Wish Creation

  1. Navigate to Special:WishlistIntake.
  2. Fill out the form with valid inputs.
  3. Click Publish wish.
  4. ✅❓❌⬜ AC1: New wish is saved with the next sequential entity ID (e.g., W3 after W2).

Test Case 2: Submission with Validation Error (Stray Pipe Character)

  1. Enter a valid title.
  2. Add a stray | character in the Description field.
  3. Click Publish wish.
  4. ✅❓❌⬜ AC2: Error message is shown and no entity ID is consumed (the next valid submission still uses the expected sequential ID)..

Test Case 3: Multiple Failed Submissions Before Correction

  1. Keep the | character in the description and attempt to publish several times.
  2. Remove the | character and click Publish wish.
  3. ✅❓❌⬜ AC3: Wish is saved successfully and Entity ID is the next in sequence (no IDs skipped because of failed attempts).

QA Results - Meta Beta

ACStatusDetails
1T404108#11217237
2T404108#11217237
3T404108#11220796

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
KSiebert lowered the priority of this task from High to Medium.Sep 10 2025, 9:53 AM
Cparle lowered the priority of this task from Medium to Low.Sep 10 2025, 10:07 AM

ID generation occurs at the API layer. The actual entity creation (Wish/FocusArea) happens much later and can fail. This could be an eyesore, but I don't think it is a showstopper. Either way, not sure how to address this since we need the page to be in place before the parser hooks kick in.

MusikAnimal renamed this task from ID generation skips to the next ID if the entity didn't save to Do all validations possible before generating a new entity ID.Sep 10 2025, 6:13 PM
MusikAnimal raised the priority of this task from Low to Medium.
MusikAnimal updated the task description. (Show Details)

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

[mediawiki/extensions/CommunityRequests@master] api: perform all validations possible before generating a new ID

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

Change #1188484 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] api: perform all validations possible before generating a new ID

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

@MusikAnimal Please review the Focus GIFs since I seem to get an error each time trying to submit one.

Test Result - Meta Beta

Status: ✅ PASS❌ FAIL
Environment: Meta Beta
OS: macOS Tahoe 26.0
Browser: Chrome 140
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Normal Wish Creation

  1. Navigate to Special:WishlistIntake.
  2. Fill out the form with valid inputs.
  3. Click Publish wish.
  4. ✅❓ AC1: New wish is saved with the next sequential entity ID (e.g., W3 after W2).
✅Wish❌Focus✅Mobile
2025-09-22_16-24-23.mp4.gif (1,290×986 px, 3 MB)
2025-09-23_07-51-54.mp4.gif (1,190×974 px, 2 MB)
2025-09-22_16-28-54.mp4.gif (1,064×976 px, 1 MB)

Test Case 2: Submission with Validation Error (Stray Pipe Character)

  1. Enter a valid title.
  2. Add a stray | character in the Description field.
  3. Click Publish wish.
  4. ✅❓❌⬜ AC2: Error message is shown and no entity ID is consumed (the next valid submission still uses the expected sequential ID)..
✅WishFocus
2025-09-22_16-27-15.mp4.gif (1,272×982 px, 1 MB)
2025-09-22_16-31-55.mp4.gif (904×984 px, 1 MB)

Test Case 3: Multiple Failed Submissions Before Correction

  1. Keep the | character in the description and attempt to publish several times.
  2. Remove the | character and click Publish wish.
  3. ✅❓❌⬜ AC3: Wish is saved successfully and Entity ID is the next in sequence (no IDs skipped because of failed attempts).
✅WishFocus
2025-09-22_16-28-21.mp4.gif (1,078×988 px, 2 MB)
See AC1 and AC2
GMikesell-WMF changed the task status from Open to In Progress.Sep 23 2025, 3:00 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.

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

[mediawiki/extensions/CommunityRequests@master] Api: Use try/catch when performing parser validations

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

Change #1190721 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Api: Use try/catch when performing parser validations

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

@MusikAnimal Please Review AC3 for FA.

Test Result - Meta Beta

Status: ✅ PASS❌ FAIL
Environment: Meta Beta
OS: macOS Tahoe 26.0
Browser: Chrome 140
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Normal Wish Creation

  1. Navigate to Special:WishlistIntake.
  2. Fill out the form with valid inputs.
  3. Click Publish wish.
  4. AC1: New wish is saved with the next sequential entity ID (e.g., W3 after W2).
✅Wish✅Focus✅Mobile
2025-09-22_16-24-23.mp4.gif (1,290×986 px, 3 MB)
2025-09-22_16-28-54.mp4.gif (1,064×976 px, 1 MB)

Test Case 2: Submission with Validation Error (Stray Pipe Character)

  1. Enter a valid title.
  2. Add a stray | character in the Description field.
  3. Click Publish wish.
  4. AC2: Error message is shown and no entity ID is consumed (the next valid submission still uses the expected sequential ID)..
✅Wish✅ Focus
2025-09-22_16-27-15.mp4.gif (1,272×982 px, 1 MB)
2025-09-25_13-33-14.mp4.gif (1,072×984 px, 2 MB)

Test Case 3: Multiple Failed Submissions Before Correction

  1. Keep the | character in the description and attempt to publish several times.
  2. Remove the | character and click Publish wish.
  3. AC3: Wish is saved successfully and Entity ID is the next in sequence (no IDs skipped because of failed attempts).

Had a pipe character on creating a FA and tried to submit a few times. When I removed it and tried to submit it, I kept on getting the same error.

✅Wish❌ Focus
2025-09-22_16-28-21.mp4.gif (1,078×988 px, 2 MB)

Had a pipe character on creating a FA and tried to submit a few times. When I removed it and tried to submit it, I kept on getting the same error.

You are missing the closing ]] in [[User:StorageCell|StorageCell in the "Community members" field.

Had a pipe character on creating a FA and tried to submit a few times. When I removed it and tried to submit it, I kept on getting the same error.

You are missing the closing ]] in [[User:StorageCell|StorageCell in the "Community members" field.

@MusikAnimal Oh boy, smh, haha. That is correct. We are good to go now. I will mark this as Resolved. Thanks for all your work!

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.