Page MenuHomePhabricator

After submitting edit and returning to view page with toast, location is not updated to remove success=true queryparam
Closed, ResolvedPublicBUG REPORT

Description

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

  • While logged into Wikifunctions, select Edit on any Z-Object e.g. Z21000
  • Make any edit and submit

What happens?:

Observe you are redirected to e.g. https://www.wikifunctions.org/view/en/Z21000?success=true. The presence of the queryparam is checked to show a "Your changes have been successfully published!" toast, but the handler for that doesn't also adjust the page URI, meaning the toast will reappear if you navigate away and then go Back. The queryparam also pollutes browser autocomplete.

What should have happened instead?:

Something like

const queryparams = new URLSearchParams(location.search);
queryparams.delete("success");
history.replaceState(null, "", location.pathname + (queryparams.size === 0 ? "" : `?${queryparams}`) + location.hash);

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Wikifunctions.org

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

FF 135 or Chromium 133, NixOS

Event Timeline

Jdforrester-WMF subscribed.

Is this also true for other editing software? I see ?success=true a lot in other contexts too.

Change #1131343 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[mediawiki/extensions/WikiLambda@master] FuntionViewer: After displaying a success message toast, remove success=true queryparam

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

Change #1131343 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] FuntionViewer: After displaying a success message toast, remove success=true queryparam

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

DSantamaria changed the task status from Open to In Progress.Mar 31 2025, 11:19 AM
DSantamaria assigned this task to DSmit-WMF.

That ticket you are mentioning is fixed + also removes ?success=true param from the url. SO that will also fix this ticket. But it will be deployed this week or next week or so.

T341672 seems related.

Please do not re-open old tasks that are Resolved. If you think they've regressed, you can file a new task (or in this case, just comment there).