Page MenuHomePhabricator

Special:CommunityConfiguration/BlockedDomain stores objects instead of arrays
Closed, ResolvedPublic

Description

Splitting a bug report from T393240.

I’m not sure if it’s caused by these changes, but the timing is suspicious: please take a look at https://en.wikipedia.org/w/index.php?title=MediaWiki:BlockedExternalDomains.json&diff=1307447522 – the page turned from a JSON array into a JSON object. This made this particular edit much larger than necessary, and it’ll make any future deletions also much larger than necessary, since all domains following the deleted one will get renumbered. Can someone please fix it so that the page is again a JSON array?

Edit: I tested it locally, and as soon as I disable the CommunityConfiguration extension (and thus edit the page on Special:BlockedExternalDomains instead of Special:CommunityConfiguration/BlockedDomain), the special page starts to write arrays, and I cannot even save the page with the object version (if I try to edit the page directly). So it’s definitely caused by the CommunityConfiguration integration.

This can be reproduced by making a change via Special:CommunityConfiguration/BlockedDomain. The expected behaviour is that MediaWiki:BlockedExternalDomains.json holds an array, not an object.

Event Timeline

Change #1192891 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] Move sorting values into DataProvider

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

Change #1192891 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Move sorting values into DataProvider

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

Status: ⬜ Not QA Testable
Rationale: Backend/config storage issue (objects vs arrays) not visible in UI interactions.

Status: ⬜ Not QA Testable
Rationale: Backend/config storage issue (objects vs arrays) not visible in UI interactions.

This should be testable with admin permissions, as the storage is on-wiki (MediaWiki:BlockedExternalDomains.json, specifically). For example, as of writing, MediaWiki:BlockedExternalDomains.json@cswiki looks like this (permalink):

{
	"0": {
		"domain": "atchina.com.cn",
		"notes": "[[.dm.bat]] a jiné od jakéhosi čínského automatu (importováno z [[Special:PermaLink/22560138|MediaWiki:Spam-blacklist]])"
	},
	"1": {
		"domain": "caws.cn",
		"notes": "[[.dm.bat]] a jiné od jakéhosi čínského automatu (importováno z [[Special:PermaLink/22560138|MediaWiki:Spam-blacklist]])"
	},
       // ...
}

As you can see, it is an object with a numeric index. If I use Special:CommunityConfiguration/BlockedDomain to save something (for example, I blocked test-domain.example), the format should fix. On cswiki, it doesn't work yet (as it is on wmf.21, and the patch is in wmf.22), but it should once the train rolls forward.

I think we should test that:

  • the blocked domain logic works both when there is an array (expected storage format) and when there's an object (unexpected format, but present on some of the wikis due to this bug),
  • that any update via Special:CommunityConfiguration/BlockedDomain fixes the format to the expected one

I'm not sure if you need any extra permissions for this – if needed, I'm happy to assign adminship on test.wikipedia.org and/or beta wikis.

Thanks for the fix! I’m not sure if I would’ve ever guessed this was the cause.

This appears fixed and can be closed