Page MenuHomePhabricator

No Edit events recorded from mobile editors
Closed, ResolvedPublic

Description

Beginning in late June or early July 2018, we stopped recording any Edit schema events from either of the mobile editors (see this notebook for full analysis).

I ran the following query on 5 September:

select
    left(timestamp, 6) as month,
    sum(event_editor = "wikitext") as wikitext_events,
    sum(event_editor = "visualeditor") as visualeditor_events
from log.Edit_17541122
where
    event_platform = "phone"
group by left(timestamp, 6)

    month  wikitext_events  visualeditor_events
0  201712        2037604.0              28271.0
1  201801        4341238.0              59143.0
2  201802        3897444.0              53763.0
3  201803        4220510.0              59607.0
4  201804        4084998.0              57519.0
5  201805        4263057.0              49500.0
6  201806        4170920.0              61958.0
7  201807            686.0                 16.0
8  201808             68.0                  0.0

There have been a few recent validation errors, but not nearly enough to account for the roughly 500 000 missing events every month. So it seems like the mobile events are just not getting sent.

select
    date_format(from_unixtime(timestamp), "YYYY-MM") as month,
    count(*) as errors
from event.eventerror
where
    year = 2018 and
    month >= 5 and
    event.schema = "Edit"
group by date_format(from_unixtime(timestamp), "YYYY-MM")

     month  errors
0  2018-04       3
2  2018-05    5034
3  2018-06    2481
4  2018-07    7251
5  2018-08    3073

Event Timeline

Neil_P._Quinn_WMF added a subscriber: Ottomata.EditedSep 5 2018, 10:54 PM

@Jdlrobson mentioned in T202786 that he successfully sent an mobile event while testing, so perhaps there are some validation issues going on as well. I saw some errors in the logs, but not nearly enough to explain this. @Ottomata, do you have any ideas by any chance?

Neil_P._Quinn_WMF removed Neil_P._Quinn_WMF as the assignee of this task.Sep 5 2018, 11:38 PM
Neil_P._Quinn_WMF moved this task from Triage to Tracking on the Product-Analytics board.

I noticed that Schema.Edit is not being loaded on mobile.
The following code ( $resourceLoader->isModuleRegistered( 'schema.Edit' ) conditional ) is suspicious and I don't think it is running:

if ( ExtensionRegistry::getInstance()->isLoaded( 'EventLogging' ) ) {
        // schema.Edit is provided by WikimediaEvents
        if ( $resourceLoader->isModuleRegistered( 'schema.Edit' ) ) {
                  $schemaEdit += [
                        'dependencies' => [
                                'schema.Edit',
                                'mobile.startup'
                        ],
                        'scripts' => [
                                'resources/mobile.loggingSchemas/schemaEdit.js',
                        ]
                ];

The ResourceLoader module 'schema.Edit' is not being loaded by the client for some reason.
There were some changes to EventLogging by @Legoktm and @Krinkle around the time this went down, but I don't see anything obvious.

I've added code to MediaWiki:Mobile.js to make sure the schema is loading to see if the absence of this module is the problem:
https://en.m.wikipedia.org/wiki/Special:MobileDiff/859576064

That code looks problematic since schema modules are loaded in the same hook, and there's no guarantee that MobileFrontend's hook will run before EventLogging's does. Is there any reason MF can't use mw.track to lazy-load the schema like most other extensions now do?

That code looks problematic since schema modules are loaded in the same hook, and there's no guarantee that MobileFrontend's hook will run before EventLogging's does. Is there any reason MF can't use mw.track to lazy-load the schema like most other extensions now do?

I agree. This is likely legacy code that nobody bothered to update > T204584

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

I've added code to MediaWiki:Mobile.js to make sure the schema is loading to see if the absence of this module is the problem:
https://en.m.wikipedia.org/wiki/Special:MobileDiff/859576064

Unfortunately, this didn't work out—we didn't get any more events since that change.

select
    left(timestamp, 10) as hour,
    count(*)
from log.Edit_17541122
where
    event_platform = "phone" and
    timestamp >= "20180914"
group by left(timestamp, 10)

hour        count(*)
2018091404         1
2018091411         2
2018091422        29
2018091507         2

@Jdlrobson and I just decided that we'd sync up tomorrow to see whether events start coming in after the train deploy of his patch.

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

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

I've added code to MediaWiki:Mobile.js to make sure the schema is loading to see if the absence of this module is the problem:
https://en.m.wikipedia.org/wiki/Special:MobileDiff/859576064

Unfortunately, this didn't work out—we didn't get any more events since that change.

Reminder to revert the above if/when it isn't needed. Haven't confirmed, but likely causes extra overhead early during the page load process. It might also hinder the ability to batch the requests for schema modules due to one being demanded separately before the batch is discovered.

Reminder to revert the above if/when it isn't needed. Haven't confirmed, but likely causes extra overhead early during the page load process. It might also hinder the ability to batch the requests for schema modules due to one being demanded separately before the batch is discovered.

Jon did this yesterday, for the record :)

Neil_P._Quinn_WMF closed this task as Resolved.Sep 19 2018, 9:57 PM
Neil_P._Quinn_WMF claimed this task.

I'm going to go ahead and call this fixed!

Jon did some testing when the patch rolled out to Mediawiki.org yesterday and had some phone events successfully recorded, and today we saw a big spike in phone events right around 19:00 UTC, when the train went to group 1.

select
    left(timestamp, 10) as hour,
    count(*)
from log.Edit_17541122
where
    event_platform = "phone" and
    timestamp >= "20180915"
group by left(timestamp, 10)

          hour  count(*)
0   2018091507         2
1   2018091721         2
2   2018091812         2
3   2018091814         2
4   2018091821        14
5   2018091823         1
6   2018091900         1
7   2018091904         1
8   2018091905         1
9   2018091909         9
10  2018091912        13
11  2018091915         4
12  2018091919       118
13  2018091920       191
14  2018091921       124