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

Schnark created this task.Oct 19 2018, 8:53 AM
Restricted Application added a project: Community-Tech. · View Herald TranscriptOct 19 2018, 8:53 AM
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, so if there is a userjs- option with the same name locally, it has no effect.

Restricted Application added a project: Platform Engineering. · View Herald TranscriptAug 13 2020, 9:41 AM
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