Page MenuHomePhabricator

Resetting a custom global preference via API does not work
Open, Needs TriagePublic

Description

This got lost due to my confusion in T203864: Resetting a global preference via API does not work:

I can set custom (i.e. prefixed with userjs-) options globally, but I can't make them local again:

  1. Save userjs-foo=foo as global preference: https://de.wikipedia.org/wiki/Spezial:ApiSandbox#action=globalpreferences&format=json&change=userjs-foo%3Dfoo
  2. Confirm it is set properly: https://de.wikipedia.org/wiki/Spezial:ApiSandbox#action=query&format=json&meta=globalpreferences
  3. Remove userjs-foo as global preference: https://de.wikipedia.org/wiki/Spezial:ApiSandbox#action=globalpreferences&format=json&change=userjs-foo
  4. Repeat step 2.

(Don't forget to fill in the tokens in step 1 and 3.)

Expected: The preference should be gone.
Actual: It is still there, with the old value, even though step 3 complete with "success".

Event Timeline

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

I've come across this with Convenient-Discussions trying to delete a property created for testing purposes, and I couldn't. I was lucky not to mess with the users' options (only faced this behavior while in the development stage)—they would have an undeletable junk option. A particularly unfortunate feature of this is that global preferences override local ones by default, so if there is a userjs- option with the same name locally, then, unless there is a local override set (which requires additional actions), it has no effect.

eprodromou added a subscriber: eprodromou.

I think we got automatically tagged because of the API but since this is GP probably better for Community Tech to handle. Re-tag us if we're needed.

I think we got automatically tagged because of the API but since this is GP probably better for Community Tech to handle. Re-tag us if we're needed.

@Niharika removed Community-Tech, so I assume they weren't interested in handling this though

@Pppery Jinx! :D

I'd like to add that reset for action=globalpreferences also doesn't work, whether resetkinds is specified or not.

So how may we get this solved? I tried poking at the code with Vagrant the other day but it quickly became clear it was above my pay grade...