Page MenuHomePhabricator

JS Error: Value null is the wrong type for property "totalInteractionTime"
Closed, ResolvedPublic3 Estimate Story Points

Description

Popups fail with JS error: [Popups] Value null is the wrong type for property "totalInteractionTime" (integer expected)
Stacktrace:

 <anonymous> https://en.wikipedia.beta.wmflabs.org/w/load.php:42:180
	handler https://en.wikipedia.beta.wmflabs.org/w/load.php:154:832
	jQuery.Callbacks/fire https://en.wikipedia.beta.wmflabs.org/w/load.php:45:104
	jQuery.Callbacks/fire https://en.wikipedia.beta.wmflabs.org/w/load.php:45:239
	jQuery.Callbacks/self.fireWith https://en.wikipedia.beta.wmflabs.org/w/load.php:46:431
	jQuery.Callbacks/self.fire https://en.wikipedia.beta.wmflabs.org/w/load.php:46:474
	mw.track https://en.wikipedia.beta.wmflabs.org/w/load.php:154:614
	Schema.prototype.log https://en.wikipedia.beta.wmflabs.org/w/load.php:133:222
	["./src/changeListeners/eventLogging.js"]/module.exports/< https://en.wikipedia.beta.wmflabs.org/w/load.php:69:684
	["./src/changeListener.js"]/module.exports/< https://en.wikipedia.beta.wmflabs.org/w/load.php:69:429
	dispatch https://en.wikipedia.beta.wmflabs.org/w/load.php:55:722
	createThunkMiddleware/</</< https://en.wikipedia.beta.wmflabs.org/w/load.php:50:404
	dispatch https://en.wikipedia.beta.wmflabs.org/w/load.php:58:566
	["./src/actions.js"]/actions.linkDwell/< https://en.wikipedia.beta.wmflabs.org/w/load.php:68:22
	createThunkMiddleware/</</< https://en.wikipedia.beta.wmflabs.org/w/load.php:50:356
	bindActionCreator/< https://en.wikipedia.beta.wmflabs.org/w/load.php:58:964
	["./src/index.js"]/</</< https://en.wikipedia.beta.wmflabs.org/w/load.php:80:897
	jQuery.event.dispatch https://en.wikipedia.beta.wmflabs.org/w/load.php:65:913
	jQuery.event.add/elemData.handle https://en.wikipedia.beta.wmflabs.org/w/load.php:60:459

Steps to reproduce:
hover over a link, wait for the popup to become visible, move mouse quickly out of popup and bring it back over a popup. It's an edge case, probably some race condition as it doesn't fail every time.

Event Timeline

pmiazga created this task.Apr 19 2017, 4:29 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 19 2017, 4:29 PM
Jdlrobson assigned this task to phuedx.Apr 19 2017, 6:40 PM
Jdlrobson moved this task from Incoming to Needs Prioritization on the Readers-Web-Backlog board.
Jdlrobson added a subscriber: Jdlrobson.

Any theories?

The issue still exists on beta cluster.

Jdlrobson triaged this task as Low priority.May 2 2017, 5:12 PM

This is an edge case.

Jdlrobson set the point value for this task to 3.May 2 2017, 5:17 PM
phuedx added a comment.EditedMay 4 2017, 11:10 AM

This is due to being unable to distinguish between a LINK_DWELL being dispatched by a link hover or a preview hover. When we dispatch the latter, we can't/don't include the link element that the user is dwelling on.

This can be fixed in one of three ways:

  1. Distinguish LINK_DWELL for a preview hover by testing if action.el is set, e.g.
src/reducers/eventLogging.js
var isPreviewDwell = action.el === undefined;

if ( state.interaction && ( isPreviewDwell || action.el === state.interaction.link ) ) {
  // Mark the user as dwelling.
}
  1. Feeding the link element through to ext.popups.Renderer#show much like we do with the token.
  2. Creating a new action, PREVIEW_DWELL and reducing it as above.
ovasileva raised the priority of this task from Low to Medium.May 4 2017, 5:53 PM
phuedx removed phuedx as the assignee of this task.May 17 2017, 3:12 PM
pmiazga claimed this task.May 23 2017, 6:59 PM

I cannot reproduce it any more

Not possible to reproduce, as @phuedx says it's probably fixed by rEPOP293d7ebe8dd84880cb8e7e8163d7d908e48baf21

pmiazga removed pmiazga as the assignee of this task.May 25 2017, 3:09 PM
bmansurov closed this task as Resolved.May 25 2017, 5:55 PM
bmansurov removed bmansurov as the assignee of this task.
bmansurov added a subscriber: bmansurov.

I also cannot re-produce the issue even after checking out cf0ea9db7bdede6a1062962b362398f10aed7a5f.