Page MenuHomePhabricator

Uncaught error in some Wikipedia Preview instances in Diff blog
Open, HighPublicBUG REPORT

Description

There's an uncaught TypeError seen on a couple of Diff blog posts. You can reproduce it by hovering over the following target texts in their respective links and looking at the console log:

As of right now the preview correctly lands on its error state. The complete error message is:

Uncaught TypeError: Window.getComputedStyle: Argument 1 is not an object.
... 
onShow()...

Note: the console error was somewhat independent from the other issues and was fixed and released in v1.0.6 of the plugin.

Event Timeline

The preview on "Giving Tuesday" works well for me (right preview, no console error).

SBisson triaged this task as High priority.
SBisson moved this task from Backlog to Dev on the Inuka-Team (Kanban) board.
SBisson added a subscriber: Ainali.

This has been reported on the project talk page as well by @Ainali

It looks like the summary PCS endpoint is giving a "no-extract" response for pages outside of the article namespace but there is still a "description" (local or from wd) that could be usable. Note that the media-list endpoint works as expected so the gallery feature is OK.

I'll try to special-case the "no-extract with description" for now so it doesn't show an error and check if we can get a proper extract as a second step.

It turns out the issues with the Diff blog posts and the pages in other namespaces are distinct.

The Diff blog links are just plain wrong and will have to be fixed in the posts themselves.

The issue of supporting pages in other namespaces should be fixed in this PR: https://github.com/wikimedia/wikipedia-preview/pull/134

As far as I can see, the same error is shown for links to redirects and for “red links” (thus links to ?action=edit of non-existing pages). For the former I would expect to be shown the preview of the page it redirects to, for the latter I would recommend a more specific error message, if possible (“read on Wikipedia” is a misleading description if it leads to editing a page).

As far as I can see, the same error is shown for links to redirects and for “red links” (thus links to ?action=edit of non-existing pages). For the former I would expect to be shown the preview of the page it redirects to,

Definitely

for the latter I would recommend a more specific error message, if possible (“read on Wikipedia” is a misleading description if it leads to editing a page).

I think a preview on a red link goes against the purpose of the product and is most likely a configuration error, or the page was deleted. Thinking about the end user, it might be better not showing anything instead of an error the user can do nothing about.