Page MenuHomePhabricator

Catch the FederatedPropertiesException for summary formatting and just show the "linked PIDs" instead in those cases
Closed, ResolvedPublic

Description

The formatting of these edit summaries happens in HtmlPageLinkRendererEndHookHandler.
The main problem part will be the retrieval/lookup of labels for the formatting (though there might be other parts that fail too?)

The stacktrace shows that the first failure actually happens before the labels are retrieved for formatting, when namespace info is looked up.
Perhaps this lookup is not needed and could just be disabled? (TODO decide).
If not, perhaps product would be okay with this not being linked? or we might need to rethink how linking happens to avoid this API call?

Example stacktrace:

[5a4d818feea0a039542c4532] /w/index.php?title=Item:Q1&action=history Wikibase\Repo\FederatedProperties\ApiRequestExecutionException from line 49 of /var/www/html/extensions/Wikibase/repo/includes/FederatedProperties/GenericActionApiClient.php:

Backtrace:

#0 /var/www/html/extensions/Wikibase/repo/includes/FederatedProperties/ApiEntityNamespaceInfoLookup.php(53): Wikibase\Repo\FederatedProperties\GenericActionApiClient->get(array)
#1 /var/www/html/extensions/Wikibase/repo/includes/FederatedProperties/ApiEntityNamespaceInfoLookup.php(41): Wikibase\Repo\FederatedProperties\ApiEntityNamespaceInfoLookup->fetchNamespaces()
#2 /var/www/html/extensions/Wikibase/repo/includes/FederatedProperties/ApiEntityTitleTextLookup.php(24): Wikibase\Repo\FederatedProperties\ApiEntityNamespaceInfoLookup->getNamespaceNameForEntityType(string)
#3 /var/www/html/extensions/Wikibase/repo/includes/FederatedProperties/ApiEntityUrlLookup.php(30): Wikibase\Repo\FederatedProperties\ApiEntityTitleTextLookup->getPrefixedText(Wikibase\DataModel\Entity\PropertyId)
#4 /var/www/html/extensions/Wikibase/repo/includes/FederatedProperties/ApiEntityUrlLookup.php(45): Wikibase\Repo\FederatedProperties\ApiEntityUrlLookup->getFullUrl(Wikibase\DataModel\Entity\PropertyId)
#5 /var/www/html/extensions/Wikibase/lib/includes/Store/TypeDispatchingUrlLookup.php(30): Wikibase\Repo\FederatedProperties\ApiEntityUrlLookup->getLinkUrl(Wikibase\DataModel\Entity\PropertyId)
#6 /var/www/html/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(260): Wikibase\Lib\Store\TypeDispatchingUrlLookup->getLinkUrl(Wikibase\DataModel\Entity\PropertyId)
#7 /var/www/html/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(168): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->doHtmlPageLinkRendererEnd(MediaWiki\Linker\LinkRenderer, Title, HtmlArmor, array, RequestContext, NULL)
#8 /var/www/html/includes/HookContainer/HookContainer.php(320): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler::onHtmlPageLinkRendererEnd(MediaWiki\Linker\LinkRenderer, TitleValue, boolean, HtmlArmor, array, NULL)
#9 /var/www/html/includes/HookContainer/HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#10 /var/www/html/includes/HookContainer/HookRunner.php(2071): MediaWiki\HookContainer\HookContainer->run(string, array)
#11 /var/www/html/includes/linker/LinkRenderer.php(396): MediaWiki\HookContainer\HookRunner->onHtmlPageLinkRendererEnd(MediaWiki\Linker\LinkRenderer, TitleValue, boolean, HtmlArmor, array, NULL)
#12 /var/www/html/includes/linker/LinkRenderer.php(381): MediaWiki\Linker\LinkRenderer->buildAElement(TitleValue, HtmlArmor, array, boolean)
#13 /var/www/html/includes/linker/LinkRenderer.php(183): MediaWiki\Linker\LinkRenderer->makeBrokenLink(TitleValue, HtmlArmor, array, array)
#14 /var/www/html/includes/Linker.php(126): MediaWiki\Linker\LinkRenderer->makeLink(TitleValue, HtmlArmor, array, array)
#15 /var/www/html/includes/Linker.php(1469): Linker::link(TitleValue, string, array, array, array)
#16 /var/www/html/includes/Linker.php(1416): Linker::makeCommentLink(TitleValue, string, NULL)
#17 [internal function]: Linker::{closure}(array)
#18 /var/www/html/includes/Linker.php(1434): preg_replace_callback(string, Closure, string)
#19 /var/www/html/includes/Linker.php(1209): Linker::formatLinksInComment(string, Title, boolean, NULL)
#20 /var/www/html/includes/Linker.php(1583): Linker::formatComment(string, Title, boolean, NULL)
#21 /var/www/html/includes/Linker.php(1634): Linker::commentBlock(string, Title, boolean, NULL, boolean)
#22 /var/www/html/includes/actions/pagers/HistoryPager.php(432): Linker::revComment(MediaWiki\Revision\RevisionStoreRecord, boolean, boolean, boolean)
#23 /var/www/html/includes/actions/pagers/HistoryPager.php(137): HistoryPager->historyLine(stdClass, stdClass, boolean, boolean, boolean)
#24 /var/www/html/includes/pager/IndexPager.php(588): HistoryPager->formatRow(stdClass)
#25 /var/www/html/includes/actions/HistoryAction.php(305): IndexPager->getBody()
#26 /var/www/html/includes/actions/FormlessAction.php(43): HistoryAction->onView()
#27 /var/www/html/includes/MediaWiki.php(527): FormlessAction->show()
#28 /var/www/html/includes/MediaWiki.php(313): MediaWiki->performAction(Article, Title)
#29 /var/www/html/includes/MediaWiki.php(940): MediaWiki->performRequest()
#30 /var/www/html/includes/MediaWiki.php(543): MediaWiki->main()
#31 /var/www/html/index.php(53): MediaWiki->run()
#32 /var/www/html/index.php(46): wfIndexMain()
#33 {main}

Event Timeline

Addshore created this task.Jul 6 2020, 2:04 PM
Addshore triaged this task as Medium priority.Jul 8 2020, 10:34 AM

Change 611020 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] FP: Handle FP exceptions in HtmlPageLinkRendererEndHookHandler

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

Change 611020 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] FP: Handle FP exceptions in HtmlPageLinkRendererEndHookHandler

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

Addshore closed this task as Resolved.Jul 22 2020, 8:08 AM

Resolved as it's in the Done column at the end of sprint 3 (start of sprint 4)