Page MenuHomePhabricator

Popup becomes visible for a fraction of a second if link was hovered when AJAX request gets triggered
Closed, ResolvedPublic2 Story Points

Description

If you hover over a link and keep mouse pointer over a link for 0.2-0.5s (probably till AJAX request is fired) and move mouse away (before popups becomes visible) - after request is made popup becomes visible for a fraction of a second and then gets dismissed.

Browser: Firefox
Expected scenario: no popup is presented to a user

Event Timeline

pmiazga created this task.Apr 19 2017, 4:44 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 19 2017, 4:44 PM
pmiazga updated the task description. (Show Details)Apr 19 2017, 5:15 PM

I'm not sure why this would've been introduced during the last sprint but it's actually fairly easy to fix: don't reduce FETCH_COMPLETE if the user has abandoned the link (state.isUserDwelling is falsy) in src/reducers/preview.js:

src/reducers/preview.js
switch ( action.type ) {
  case actionTypes.FETCH_COMPLETE:
    if ( action.token === state.interaction.token ) {
      /* ... */
    }
}

becomes:

src/reducers/preview.js
switch ( action.type ) {
  case actionTypes.FETCH_COMPLETE:
    if ( action.token === state.activeToken && state.isUserDwelling ) {
      /* ... */
    }
}

^ OK. That change doesn't fix the problem all of the time but it makes it very hard to trigger the condition.

ovasileva triaged this task as High priority.Apr 20 2017, 5:11 PM
ovasileva set the point value for this task to 2.Apr 20 2017, 5:17 PM
ovasileva moved this task from Needs Analysis to To Do on the Reading-Web-Sprint-96 board.
phuedx claimed this task.Apr 21 2017, 9:42 AM
phuedx moved this task from To Do to Doing on the Reading-Web-Sprint-96 board.

Change 349410 had a related patch set uploaded (by Phuedx):
[mediawiki/extensions/Popups@master] Don't show preview when user abandons link

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

phuedx added a subscriber: bmansurov.

@bmansurov left a comment – without signalling that he'd commented. @bmansurov… – that's worth following up on because, as usual, he's correct.

I'll try better next time. Maybe I'll ping you on IRC or -1 the change. This time I just had a question.

Change 349410 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Don't show preview if user has abandoned link

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

phuedx reassigned this task from phuedx to Jdlrobson.Apr 25 2017, 6:12 AM
pmiazga claimed this task.Apr 26 2017, 5:08 PM
pmiazga added a subscriber: Jdlrobson.

Tested on beta cluster, works nice and smooth and it's pretty difficult to reproduce the original error (popups becomes visible and immediately disappears). Marking this task as solved. Good job @phuedx !

pmiazga closed this task as Resolved.Apr 26 2017, 11:43 PM