Page MenuHomePhabricator

JS exception in Catalan wiki → TypeError: Cannot read property 'started' of undefined
Closed, DuplicatePublic

Description

What

Seen in https://ca.wikipedia.org/wiki/Portada

"TypeError: Cannot read property 'started' of undefined
    at ./src/reducers/eventLogging.js.module.exports (https://ca.wikipedia.org/w/load.php?debug=false&lang=ca&modules=ext.popups&skin=vector&version=1gn0xfc:39:497)

Source

timeToPreviewShow: action.timestamp - state.interaction.started

state.interaction == null at the time of exception

Why

state.interaction appears to be null at certain times on the eventLogging reducer.

In this case it happens when processing a PREVIEW_SHOW action, but I've seen it happen too when processing a ABANDON_END action.

How

I can't come up with steps to reproduce. Randomly flickering through links, waiting for some and not others, moving from link to link waiting for preview or after abandoning preview quickly... I don't know.

Effect on the feature

Everything works, but the logging breaks for that certain action. Followup interactions work.

Event Timeline

This is a problem that can co-occur with #1 of T159490#3150331.

Assume the gateway requests take > 300 ms seconds to complete. If user dwells on and then abandons a link but doesn't dwell on another link, then we'll see ABANDON_END happen before FETCH_END. Since the eventLogging reducer currently reduces FETCH_END actions unconditionally, a new corrupt interaction will be created in this scenario.

As with all other actions, the fetch action must use tokens.

Jdlrobson triaged this task as Medium priority.Apr 6 2017, 4:54 PM
Jdlrobson added a project: Web-Team-Backlog.
Jdlrobson subscribed.

Not user facing so have left at normal.

I'll make a point of tagging this task in the comment of the change that I submit for T159490#3150331.

^ Actually. I was wrong. This is because, like FETCH_COMPLETE actions were, PREVIEW_SHOW actions are reduced unconditionally by the eventLogging reducer.

Change 346981 had a related patch set uploaded (by Phuedx):
[mediawiki/extensions/Popups@master] Hygiene: Reduce nesting of test cases

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

Change 346981 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Hygiene: Reduce nesting of test cases

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