Page MenuHomePhabricator

MobileFrontend should not register EventLogging modules via hooks
Closed, ResolvedPublic3 Story Points

Description

MobileFrontend conditionally registers EventLogging code for Schema:Edit, Schema:Search and and Schema:MobileWebMainMenuClickTracking if EventLogging is installed.

This is problematic for several reasons

  1. creates an additional ResourceLoaderModule, increasing size of startup module
  2. Is not very discoverable (all other modules are defined in extension.json)
  3. Other extensions do not do this - they lazy load schemas via mw.loader.using (if the module doesn't exist and it fails no code is run )

QA steps

On reading web staging, Edit, Search and MobileWebMainMenuClickTracking are all enabled at 100%

Verify the following actions send events:

  • Opening a link in the main menu (either in new tab or new window)
  • Triggering a search
  • Clicking edit

It's enough to test on one browser. We only want to verify these are still working as before.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 17 2018, 6:59 PM

Change 460949 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Remove conditional Edit event logging module.

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

Change 460950 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Do not register Search and MobileWebMainMenuClickTracking via hooks

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

Change 460949 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Remove conditional Edit event logging module.

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

Jdlrobson triaged this task as Normal priority.Sep 18 2018, 4:33 PM
ovasileva set the point value for this task to 3.Sep 18 2018, 4:41 PM

Change 460950 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Do not register Search and MobileWebMainMenuClickTracking via hooks

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

Change 464064 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Move MainMenu click tracking schema from MobileFrontend to Minerva

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

Change 460951 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Search and ClickTracking sampling rates are configurable

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

Change 464065 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Menu click tracking schema now managed by Minerva

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

Change 464064 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Move MainMenu click tracking schema from MobileFrontend to Minerva

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

Change 460951 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Search and ClickTracking sampling rates are configurable

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

Change 464065 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Menu click tracking schema now managed by Minerva

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

Jdlrobson assigned this task to Ryasmeen.Oct 5 2018, 5:50 PM
Jdlrobson added a project: Product-QA.
Jdlrobson updated the task description. (Show Details)
pmiazga claimed this task.Nov 14 2018, 6:15 PM
pmiazga added a subscriber: Ryasmeen.
pmiazga added a comment.EditedNov 15 2018, 6:30 PM

For MenuClick I get the event:

{"event":{"mobileMode":"stable","name":"random","destination":"/wiki/Special:Random#/random"},"revision":11568715,"schema":"MobileWebMainMenuClickTracking","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

Triggering search sends:

{"event":{"platform":"mobileweb","platformVersion":"stable","action":"session-start","userSessionToken":"3c75f8e8959c64f0254a","searchSessionToken":"a617eed9d572dfa7a5c7","timeOffsetSinceStart":0},"revision":12054448,"schema":"MobileWebSearch","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

Displaying search results triggers:

{"event":{"platform":"mobileweb","platformVersion":"stable","action":"impression-results","resultSetType":"prefix","numberOfResults":6,"userSessionToken":"3c75f8e8959c64f0254a","searchSessionToken":"a617eed9d572dfa7a5c7","timeToDisplayResults":506,"timeOffsetSinceStart":506},"revision":12054448,"schema":"MobileWebSearch","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

Editing doesn't sent an event.

But I get events on every pageLoad:

{"event":{"pageTitle":"New York State Route 22","namespaceId":0,"skin":"minerva","isAnon":true,"pageToken":"c69bf859db192fe3fde2","sessionToken":"3a29c39d0ca931525eef","action":"pageLoaded","domInteractiveTime":1333,"default_sample":true},"revision":18201205,"schema":"ReadingDepth","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

and pageUnload

{"event":{"pageTitle":"New York State Route 22","namespaceId":0,"skin":"minerva","isAnon":true,"pageToken":"abdcd28afffe6f6b8200","sessionToken":"3a29c39d0ca931525eef","action":"pageUnloaded","domInteractiveTime":1226,"default_sample":true,"totalLength":66184,"visibleLength":49999},"revision":18201205,"schema":"ReadingDepth","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};
pmiazga removed pmiazga as the assignee of this task.Nov 15 2018, 7:22 PM
pmiazga added a subscriber: pmiazga.
pmiazga assigned this task to Jdlrobson.Nov 15 2018, 7:28 PM

Change 473823 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Edit schema: Dead code elimination

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

Looks like editing team made some changes. I've reconfigured the staging environment and it appears to be working now.

Found some dead code in the process: https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/473823 Edit schema: Dead code elimination

Jdlrobson removed Jdlrobson as the assignee of this task.Nov 15 2018, 7:31 PM

Change 473823 abandoned by Jdlrobson:
Edit schema: Dead code elimination

Reason:
See https://gerrit.wikimedia.org/r/473935

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

Tested, works as expected, I see edit events:

{"event":{"page_id":2177920,"revision_id":40,"page_title":"New_York_State_Route_22","page_ns":0,"user_id":17,"user_editcount":0,"mw_version":"1.33.0-alpha","platform":"phone","integration":"page","page_token":"12740c6f4804730768ec","session_token":"3a29c39d0ca931525eef","version":1,"action":"ready","editor_interface":"wikitext","editing_session_id":"79da591c3d020b08cd4b","is_oversample":false},"revision":18530416,"schema":"EditAttemptStep","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

and hitting save I get

{"event":{"page_id":2177920,"revision_id":40,"page_title":"New_York_State_Route_22","page_ns":0,"user_id":17,"user_editcount":0,"mw_version":"1.33.0-alpha","platform":"phone","integration":"page","page_token":"12740c6f4804730768ec","session_token":"3a29c39d0ca931525eef","version":1,"action":"saveIntent","editor_interface":"wikitext","editing_session_id":"79da591c3d020b08cd4b","is_oversample":false},"revision":18530416,"schema":"EditAttemptStep","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

then when it asks me to enter captcha

{"event":{"page_id":2177920,"revision_id":40,"page_title":"New_York_State_Route_22","page_ns":0,"user_id":17,"user_editcount":0,"mw_version":"1.33.0-alpha","platform":"phone","integration":"page","page_token":"12740c6f4804730768ec","session_token":"3a29c39d0ca931525eef","version":1,"action":"saveFailure","editor_interface":"wikitext","editing_session_id":"79da591c3d020b08cd4b","save_failure_type":"extensionCaptcha","is_oversample":false},"revision":18530416,"schema":"EditAttemptStep","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

then

{"event":{"page_id":2177920,"revision_id":40,"page_title":"New_York_State_Route_22","page_ns":0,"user_id":17,"user_editcount":0,"mw_version":"1.33.0-alpha","platform":"phone","integration":"page","page_token":"12740c6f4804730768ec","session_token":"3a29c39d0ca931525eef","version":1,"action":"saveAttempt","editor_interface":"wikitext","editing_session_id":"79da591c3d020b08cd4b","is_oversample":false},"revision":18530416,"schema":"EditAttemptStep","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

and when it's saved

{"event":{"page_id":2177920,"revision_id":40,"page_title":"New_York_State_Route_22","page_ns":0,"user_id":17,"user_editcount":0,"mw_version":"1.33.0-alpha","platform":"phone","integration":"page","page_token":"12740c6f4804730768ec","session_token":"3a29c39d0ca931525eef","version":1,"action":"saveSuccess","editor_interface":"wikitext","editing_session_id":"79da591c3d020b08cd4b","is_oversample":false},"revision":18530416,"schema":"EditAttemptStep","webHost":"reading-web-staging.wmflabs.org","wiki":"wiki"};

in short - WFM

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptNov 16 2018, 4:50 PM