Page MenuHomePhabricator

Improve handling of diffs between different content types
Open, Needs TriagePublic

Description

An attempt to diff two different content types (where at least one is non-text-based) typically results in an exception being thrown. This is bad form as it results in production errors (any two revisions can be diffed, and it's often possible to change the content type of a page into something incompatible). It's even worse with MCR where only one slot having different content types results in an error page, even though the user might have a legitimate need to see the diff of another slot.

Either the exception should be more specific (right now it tends to be just plain Exception, MWException, AssertionError or something similarly vague) and callers should handle it, or instead of throwing we should just return an error string (as Wikibase handled it in gerrit 349878, although it seems that re-broke since).

Event Timeline

Change 485575 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/core@master] [WIP] Improve handling of diffs between incompatible content models

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

Change 485746 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/MassMessage@master] Improve handling of diffs between incompatible content models

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

Change 485575 had a related patch set uploaded (by Tim Starling; author: Gergő Tisza):

[mediawiki/core@master] Improve handling of diffs between incompatible content models

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

Change 485575 merged by jenkins-bot:

[mediawiki/core@master] Improve handling of diffs between incompatible content models

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

Removing myself since I don't see how I can help. Please add me back if my help is needed.

I have removed a log filter from Kibana MediaWiki New Errors dashboard which pointed to the duplicate task T231084. There is no hit over the last four weeks.

The filter was:

{
  "query": {
    "regexp": {
      "labels.normalized_message": {
        "value": "Bad value for parameter .oldContent: must be a.+"
      }
    }
  }
}

There was an another filter mentioning T214217 which I have removed as well:

{
  "query": {
    "match_phrase": {
      "error.message": "Cannot diff content types other than MassMessageListContent"
    }
  }
}