Page MenuHomePhabricator

Page Preview does not appear when hovering over a link that spans multiple lines
Open, NormalPublic

Description

Steps to reproduce:

  1. Go to this page: https://en.wikipedia.org/wiki/Special:AllPages
  2. Now try to hover over the long link ""...Ich tote mich jedesmal aufs Neue, doch ich bin unsterblich, und ich erstehe wieder auf; in einer Vision des Untergangs..."
  3. While hovering over the link, move your cursor in a way that it quickly moves from first line to second line.

If you move your cursor directly to the second line from the side, then it does show up.

See the screen capture attached.

Developer notes

Watch the Redux actions in debug mode on https://en.wikipedia.org/wiki/Special:AllPages?debug=true

while hover over first line: LINK_DWELL and FETCH_START events are triggered.

When we move to the second line, an ABANDON_START event is triggered.
This is followed by an ABANDON_END and a LINK_DWELL as we hover over line 2.

The 2nd LINK_DWELL event does not trigger a fetch event.

Event Timeline

Ryasmeen created this task.Jul 13 2018, 7:55 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 13 2018, 7:55 AM
Ryasmeen updated the task description. (Show Details)Jul 13 2018, 7:57 AM
ovasileva triaged this task as Normal priority.Jul 13 2018, 2:30 PM
ovasileva moved this task from Incoming to Needs Prioritization on the Readers-Web-Backlog board.
Jdlrobson updated the task description. (Show Details)Jul 24 2018, 11:14 AM
Jdlrobson updated the task description. (Show Details)Jul 24 2018, 11:16 AM
Jdlrobson added subscribers: pmiazga, Niedzielski, Jdlrobson.

@Niedzielski and @pmiazga you recently touched this code as part of T197700.
Olga has suggested this is normal priority, but addressing this problem feels like a risky change that may impact aborted AJAX requests amongst other things. What do your guts say? Is this an oversight or is it going to be tricky to untangle?

@Jdlrobson, I think this might be a little tricky.

The previous implementation never canceled an outstanding request so if a link was _ever_ hovered over, as long as the cursor was back over the link when the request and timers _completed_, a preview would be shown. Now, as soon as the cursor leaves the link, the request is aborted and any timers canceled.

I'm guessing there's a timing issue between issuing a new request and aborting the old. In the code I see:

if (!isNewInteraction()) return $.Deferred().resolve().promise()

If this is the issue, conceptually the change may be as simple as modifying isNewInteraction() to check fetch response / timer status but I expect it will be trickier in practice to fix. I would not be surprised if this was a preexisting issue but is now greatly exacerbated :[

@ovasileva It would be worthwhile organising a spike/feasibility analysis before addressing this problem as it's risky, so we can expect this task to take up at least 2 sprints. Unsure if the priority of this task is such that we want to address it soon, given we are trying to pause work with page previews for the time being.