[go: up one dir, main page]

Page MenuHomePhabricator

ParameterTypeException when `diff`ing invalid MassMessageListContent
Closed, ResolvedPublicPRODUCTION ERROR

Description

Steps to reproduce:
Visit https://en.wikipedia.org/wiki/Wikipedia:Scripts%2B%2B/Subscribe?action=edit (or probably any other mass message list)
Make the json invalid (eg remove the first {)
Click "Show changes"

Actual result:

[8b788f40-eff9-4c15-a1f1-9d7ab39070fd] 2020-12-03 23:47:58: Fatal exception of type "Wikimedia\Assert\ParameterTypeException"
trace
#0 /srv/mediawiki/php-1.36.0-wmf.18/includes/diff/TextSlotDiffRenderer.php(138): Wikimedia\Assert\Assert::parameterType(array, NULL, string)
#1 /srv/mediawiki/php-1.36.0-wmf.18/includes/diff/DifferenceEngine.php(1466): TextSlotDiffRenderer->getTextDiff(string, NULL)
#2 /srv/mediawiki/php-1.36.0-wmf.18/extensions/MassMessage/includes/Content/MassMessageListDiffEngine.php(36): DifferenceEngine->generateTextDiffBody(string, NULL)
#3 /srv/mediawiki/php-1.36.0-wmf.18/includes/diff/DifferenceEngineSlotDiffRenderer.php(54): MediaWiki\MassMessage\Content\MassMessageListDiffEngine->generateContentDiffBody(MediaWiki\MassMessage\Content\MassMessageListContent, MediaWiki\MassMessage\Content\MassMessageListContent)
#4 /srv/mediawiki/php-1.36.0-wmf.18/includes/diff/DifferenceEngine.php(1251): DifferenceEngineSlotDiffRenderer->getDiff(MediaWiki\MassMessage\Content\MassMessageListContent, MediaWiki\MassMessage\Content\MassMessageListContent)
#5 /srv/mediawiki/php-1.36.0-wmf.18/includes/diff/DifferenceEngine.php(1156): DifferenceEngine->getDiffBody()
#6 /srv/mediawiki/php-1.36.0-wmf.18/includes/EditPage.php(3765): DifferenceEngine->getDiff(string, string)
#7 /srv/mediawiki/php-1.36.0-wmf.18/includes/EditPage.php(3675): EditPage->showDiff()
#8 /srv/mediawiki/php-1.36.0-wmf.18/includes/EditPage.php(3219): EditPage->displayPreviewArea(string, boolean)
#9 /srv/mediawiki/php-1.36.0-wmf.18/includes/EditPage.php(717): EditPage->showEditForm()
#10 /srv/mediawiki/php-1.36.0-wmf.18/includes/actions/EditAction.php(71): EditPage->edit()
#11 /srv/mediawiki/php-1.36.0-wmf.18/includes/actions/SubmitAction.php(38): EditAction->show()
#12 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(532): SubmitAction->show()
#13 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
#14 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(945): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(548): MediaWiki->main()
#16 /srv/mediawiki/php-1.36.0-wmf.18/index.php(53): MediaWiki->run()
#17 /srv/mediawiki/php-1.36.0-wmf.18/index.php(46): wfIndexMain()
#18 /srv/mediawiki/w/index.php(3): require(string)
#19 {main}

Details

Request ID
8b788f40-eff9-4c15-a1f1-9d7ab39070fd
Request URL
https://en.wikipedia.org/w/index.php?title=Wikipedia:Scripts%2B%2B/Subscribe&action=submit

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
15:52:35 <legoktm> that bug looks like EditPage is not checking whether the content is valid before trying to diff it

Maybe fixing it more general with T231084 because DiffEngine is also in the stacktrace

Change 683093 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/MassMessage@master] Handle invalid MassMessageListContent on "show changes"

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

Change 683093 merged by jenkins-bot:

[mediawiki/extensions/MassMessage@master] Handle invalid MassMessageListContent on "show changes"

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

Umherirrender claimed this task.
Umherirrender triaged this task as Medium priority.
Umherirrender removed a project: Patch-For-Review.