Page MenuHomePhabricator

[Bug] [AMC] Multiple MobileWebUIActionsTracking instrumentation errors
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

Steps to reproduce

  1. Visit https://en.m.wikipedia.org
  2. Login
  3. Enable "Advanced mode"
  4. Visit https://en.m.wikipedia.org/wiki/Maybeshewill
  5. Open the user menu button or the page actions overflow menu

Expected results

  • A MobileWebUIActionsTracking event is sent without the destination field set

Actual results

  • A MobileWebUIActionsTracking event is sent with the destination field set to null

Environments observed

All environments where the MobileWebUIActionsTracking instrumentation is enabled.

Check any additional observations

✓ Observed on the beta cluster wiki
✓ Observed on a production wiki

✓ Observed on MinervaNeue skin
✓ Observed while logged in

  • Observed while not logged in (anonymous)

Notes

418 "None is not of type 'string'" errors were in the last 24 hours for the MobileWebUIActionsTracking schema. All of those erroneous events have the destination property explicitly set to null. Because the property is present, it's validated.

One solution is to not set the property when it doesn't have a value, i.e. in ext.wikimediaEvents.mobileWebUIActions.js change:

[0]
var element = event.target,
  name = element.getAttribute( 'data-event-name' );
if ( name ) {
  schemaMobileWebUIActionsTracking.log( {
    action: 'click',
    name: name,
    token: user.sessionId(),
    destination: element.getAttribute( 'href' )
  } );
}

to

[1]
var element = event.target,
  name = element.getAttribute( 'data-event-name' )
  destination, event;

if ( !name ) {
  return;
}

event = {
  action: 'click',
  name: name,
  token: user.sessionId()
}

destination = element.getAttribute( 'href' );

if ( destination ) {
  event.destination = destination;
}

schemaMobileWebUIActionsTracking.log( event );

QA Results

ACStatusDetails
1T232723#5527208

QA Results:Production

ACStatusDetails
1T232723#5527212

Event Timeline

phuedx added a subscriber: ovasileva.

@ovasileva: I'm moved this out of Needs Analysis because the analysis is already done 🙂

This task looks good to me and we can start working on it.

Change 537478 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/WikimediaEvents@master] Do not send destination when it's not present.

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

Change 537478 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEvents@master] Do not send destination when it's not present.

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

ovasileva set the point value for this task to 2.Sep 18 2019, 5:17 PM

Test Result

Status: ✅ PASS
OS: macOS Mojave
Browser: Chrome
Device: MBP
Emulated Device: iPhoneX

Test Artifact(s):

QA Steps

  1. Login to Beta
  2. Enable "Advanced mode"
  3. Open the user menu button or the page actions overflow menu
Expected results

✅ AC1: A MobileWebUIActionsTracking event is sent without the destination field set

T7232723-beta.gif (267×638 px, 502 KB)

Test Result:Production

Status: ✅ PASS
OS: macOS Mojave
Browser: Chrome
Device: MBP
Emulated Device: iPhoneX

Test Artifact(s):

QA Steps

  1. Login to testwiki
  2. Enable "Advanced mode"
  3. Open the user menu button or the page actions overflow menu
Expected results

✅ AC1: A MobileWebUIActionsTracking event is sent without the destination field set

T7232723-test.gif (267×638 px, 421 KB)