Page MenuHomePhabricator

ZMultilingualString with duplicated languages: find a better way to handle these errors
Closed, ResolvedPublicBUG REPORT

Description

Description

Currently, ZMultilingualString duplicated languages are detected on the only validation that we use, which is on ZObjectFactory creation.
This means that these issues are not only detected on edit, but also when instantiating the object for any other reason. This creates failures unrelated to an edit action, which are not a good idea.

Patch to rethink: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/1217261


Completion checklist

Event Timeline

Jdforrester-WMF subscribed.

Possibly we need to find all the current malformed content in production and either fix them ourselves, or list them for the community to fix?

Change #1228584 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Stop Multilingual strings with duplicate languages from braking other objects

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

Yes.
Additionally, we should stop throwing an exception when detecting duplicate languages, as this breaks other requests (fetches, perform tests, etc) when a related object has a duplicate language label, which is not a major issue that justifies these crashes. Logging a warning when the error is detected should be enough for us to detect and correct bad content.
Will update this task with objects that need fixing, as not all can be fixed by the community (some require internal API to be used)

I run a script against all latest production dump and I found no errors of this type in the latest page revisions.
All previously detected errors (reported in https://www.wikifunctions.org/wiki/Wikifunctions:Request_for_cleanup#Multilingual_strings_with_duplicate_languages) are now fixed.

All the logs that we see now in Logstash are due to:

  • requests of oldid or diff of a page that had a duplicate language in old revisions,
  • objects with duplicate languages being stopped on update: this shouldn't happen if our front-end works as expected, but it would be good to observe.

For the moment, there are no additional actions required here.

Change #1228584 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] ZMultiLingualString: Stop duplicate languages from breaking other Objects

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