Page MenuHomePhabricator

Investigate why Page and Reference Previews interfere when footnote comes right behind link on English Beta Wikipedia
Closed, ResolvedPublic8 Estimated Story Points

Description

Motivation
Sometimes, when I hover over a footnote indicator, coming from an internal link, nothing happens. Although the page popup of the internal link opens and closes appropriately, it seems to interfere with the call of the reference preview

Screenshot showing the described situation

Bildschirmfoto 2019-01-25 um 14.54.40.png (314×442 px, 52 KB)

AcceptanceCriteria

  • It is clear what leads to the footnotes sometimes not showing

Notes

  • It seems like reference previews are shown wrongly, only if you come from an internal link --> Is this a timing issue?
  • Before checking this task again we should make sure that T215420 is done and merged.
  • It should also be tested if this bug turns up in production ( e.g. one of the group0 wikis )

Event Timeline

Lea_WMDE added subscribers: WMDE-Fisch, thiemowmde.

Moving @thiemowmde 's comment here

This might be related to T214710#4914267, or might become much less of a problem after T214710 is solved. Let's make sure the fix is merged before we test this again.

Lea_WMDE renamed this task from Page and Reference Previews interfere when footnote comes right behind link to Investigate why Page and Reference Previews interfere when footnote comes right behind link.Jan 29 2019, 1:47 PM
Lea_WMDE triaged this task as Medium priority.
Lea_WMDE updated the task description. (Show Details)
Lea_WMDE set the point value for this task to 8.
Lea_WMDE moved this task from In preparation to Ready for pickup on the Reference Previews board.

I tried to reproduce this, without success so far. Is there anything specific I need to do or do we have a page where it reliably happens? Or does it seem to happen only randomly?

If you go to: https://en.wikipedia.beta.wmflabs.org/wiki/Dog
then hover over the first link "carnivorous" and from there straight to the footnote indicators coming after it, you should see the described behavior.

The best idea I have so far is the ABANDON_END_DELAY, that defaults to 300 ms, and is used in a single place in the code: https://phabricator.wikimedia.org/diffusion/EPOP/browse/master/src/actions.js$266. I tried to set this to 1, and the issue seems to disappear.

Unfortunately, we can not just change this delay because this will have a bad effect for users: all popups will disappear very quickly, much quicker than wanted.

By the way, I can reproduce the issue on a page that contains a single link with a regular page preview. All I need to do is to quickly move the mouse over the link so it just briefly touches the link, leaves it, and quickly move it back on the link. If I can do this with said 300 ms, no popup will be shown.

By the way, I can reproduce the issue on a page that contains a single link with a regular page preview. All I need to do is to quickly move the mouse over the link so it just briefly touches the link, leaves it, and quickly move it back on the link. If I can do this with said 300 ms, no popup will be shown.

I can reproduce the behavior you describe above and this also seems to be an issue for the page preview popups. So it's nothing specific to our code. - But: I still seem to have issues with reference popups even if it seems the 300ms should have passed. - See the attached video. (e.g. at 00:24 )

Some findings from my latest tests around this bug:

  • I can reproduce the this quite easy on en.wp.beta and even on different pages/parts there [1] [2] [3]
  • I can't reproduce it on de.wp.beta [4] [5]
  • I can't reproduce it locally even with the imported pages

[1] https://en.wikipedia.beta.wmflabs.org/wiki/Dog#cite_ref-2 (& the link before )
[2] https://en.wikipedia.beta.wmflabs.org/wiki/Dog#cite_note-6 (& the link before )
[3] https://en.wikipedia.beta.wmflabs.org/wiki/Cat#cite_ref-6 (& the link before )
[4] https://de.wikipedia.beta.wmflabs.org/wiki/Ref_vorschau_tests#cite_ref-eins_1-2 (& the link before )
[5] https://de.wikipedia.beta.wmflabs.org/wiki/MozartReferenzTest#cite_ref-1 (& the link before )

Change 488098 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Popups@master] Fix action reducer forgetting *all* duplicate dwell actions

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

@WMDE-Fisch, I can confirm this observation.

The error descriptions we collected so far are so different, I believe we are looking at at least two different issues here. More specifically: I suggest to split the issue I described (quickly hovering the same link does not show a popup) off to a new ticket, along with the patch I uploaded.

Lea_WMDE changed the task status from Open to Stalled.Feb 6 2019, 1:01 PM

Per retro we are setting the ticket on stalled, to be rechecking the bug once we deployed to group0. @WMDE-Fisch is going to add some more info on bugs to be split up.

WMDE-Fisch removed a project: Patch-For-Review.

@WMDE-Fisch, I can confirm this observation.

The error descriptions we collected so far are so different, I believe we are looking at at least two different issues here. More specifically: I suggest to split the issue I described (quickly hovering the same link does not show a popup) off to a new ticket, along with the patch I uploaded.

I created a separate ticket for the issue of quickly hovering links T215420: Change delay for appearance of ReferencePreviews to 150ms

WMDE-Fisch added a subscriber: Andrew-WMDE.

Tried to reproduce the issue on https://test.wikipedia.org/wiki/Dog, see the link to carnivore with the following refrences in the first paragraph similar to the same page on the English beta Wikipedia.

I could not reproduce it there. @thiemowmde @Andrew-WMDE could you please try as well?

WMDE-Fisch changed the point value for this task from 8 to 2.Mar 20 2019, 1:27 PM
WMDE-Fisch moved this task from Backlog to Review on the WMDE-QWERTY-Season-Sprint-2019-03-20 board.

I tried to reproduce the issue on German Wikipedia and again failed to do so. This remains an English Beta Wikipedia mystery. I suggest to close this ticket for now or rephrase it to "{old title} on English Beta Wikipedia" and leave it alone ;-). @Lea_WMDE

Lea_WMDE renamed this task from Investigate why Page and Reference Previews interfere when footnote comes right behind link to Investigate why Page and Reference Previews interfere when footnote comes right behind link on English Beta Wikipedia.Apr 17 2019, 1:15 PM
Lea_WMDE closed this task as Declined.
Lea_WMDE moved this task from Demo to Done on the WMDE-QWERTY-Sprint-2019-04-03 board.

Declined because it only appears on en beta wikipedia

thiemowmde moved this task from Doing to In preparation on the Reference Previews board.
thiemowmde added a subscriber: awight.

With @awight we discovered a scenario we can reproduce. Basically:

  • Sometimes hovering a reference does not show a reference preview.
  • This often happens directly after the page loaded, when the first link you try to hover is a reference.
  • It also happens when quickly hovering from some other link (no matter if a page or reference preview) to a reference.
  • It never happens when hovering a page preview.
  • When debugging with the Redux DevTools I get a heavily messed up log with a ton of repeated LINK_DWELL, ABANDON_START and ABANDON_END that don't correspond to an actual action I do with the mouse.
  • One vague idea is that some code gets confused when confronted with reference links. Remember, reference links look like <a href="#fragment">. They all point to the same page (the current one). Some code might consider such links invalid, or equal when they should not be equal.
  • I tried the patch https://gerrit.wikimedia.org/r/488098 (see T219434) and it partly solves the problem. With the patch all popups are shown. The bug is not reproducible any more. But the events are still messed up the same way.
Lea_WMDE changed the point value for this task from 2 to 8.May 7 2019, 12:43 PM

This needs some more investigation to be sure we can correct this purely in the reference previews part of the code base. Part of the investigation should be writing a browser test.
The story points are meant for investigation, not yet for writing the actual solution

The misbehavior with the link seems to be related to custom styling applied on the footnote links on en.beta.WP

https://en.wikipedia.beta.wmflabs.org/w/index.php?title=MediaWiki:Cite_reference_link&action=edit

The additional <span> inside of the <a> element causes irritations with the hover events that are passed on from child to parent. So while dwelling on a link there will be several hover/unhover events triggered that all compete with each other and lead to a situation where the reducer reaches the abandon state although the link is still hovered.

Part of the issue is custom, per-wiki HTML code that looks like this: <a><span>[</span>2<span>]</span></a>. We are now able to explain a lot of what we have seen so far:

  • It explains why we can only reproduce the issue on certain machines. I, for example, once copied this messages from Beta that contains this HTML to my local dev environment, and I'm able to see the bug now because of this.
  • It explains why we see so many dwell and abandon events in the Redux console when moving the mouse from one reference to another. The mouse leaves and enters these <span> elements, each triggering new events.
  • It explains why it feels like the issue happens only "sometimes": When you enter one of these [2] links from the top, the mouse does not necessarily touch the <span> elements, and the bug does not happen. But it always happens when you enter the link from the side.

Change 509041 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Popups@master] referencePreview: No event bubbling on inner child elements

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

(patch solves the issue for me, waiting for someone with CR+2 on this repo)

Change 509041 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] referencePreview: No event bubbling on inner child elements

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