Page MenuHomePhabricator

[betalabs] EditAttemptStep has undeclared properties
Closed, ResolvedPublic

Description

On betalabs when a new user opens VE the Console EditAttemptStep schema events will display several undeclared properties:
The full stack of EditAttemptStep includes errors and the events that have been successfully validated:

EventLogging Validation: [EditAttemptStep] Undeclared property "init_message"
EventLogging Validation: [EditAttemptStep] Undeclared property "loaded_type" 
EventLogging Validation: [EditAttemptStep] Undeclared property "loaded_mechanism" 
EventLogging Validation: [EditAttemptStep] Undeclared property "loaded_message"

EditAttemptStep 
{…}event: Object { version: 1, action: "loaded", is_oversample: true, … }
​
revision: 18530416
​
schema: "EditAttemptStep"
​
webHost: "en.wikipedia.beta.wmflabs.org"
​
wiki: "enwiki"

EventLogging Validation: [EditAttemptStep] Undeclared property "ready_type" 
EventLogging Validation: [EditAttemptStep] Undeclared property "ready_mechanism" 
EventLogging Validation: [EditAttemptStep] Undeclared property "ready_message"
​
EditAttemptStep 
{…}
​
event: Object { version: 1, action: "ready", is_oversample: true, … }
​
revision: 18530416
​
schema: "EditAttemptStep"
​
webHost: "en.wikipedia.beta.wmflabs.org"
​
wiki: "enwiki"

The following properties are not listed on https://meta.wikimedia.org/wiki/Schema:EditAttemptStep.

init_message
loaded_type
loaded_mechanism
loaded_message

ready_type
ready_mechanism
ready_message

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 12 2019, 9:54 PM
JTannerWMF added a subscriber: JTannerWMF.EditedMar 19 2019, 6:01 PM

@Etonkovidova will update ticket with which editor and which console command this came from.

Etonkovidova updated the task description. (Show Details)
Etonkovidova moved this task from QA to Incoming on the Growth-Team (Current Sprint) board.

@Etonkovidova will update ticket with which editor and which console command this came from.

Done.

JTannerWMF assigned this task to DLynch.Mar 26 2019, 3:30 PM
JTannerWMF edited projects, added VisualEditor (Current work); removed VisualEditor.
JTannerWMF added a subscriber: DLynch.

@DLynch will investigate this further.

Looking at it... I think we've just always been pouring all of these in, and letting the schema accept the ones it knows about. I believe that it just discards the unknown properties, rather than the entire event in those cases, right?

I admit to not understanding why we did that foo_type thing in the first place, as opposed to just having type and using the existing action field to filter it. 🤷‍♂️

Still, I can probably knock up a quick patch to whitelist which of the action-types need those properties.

Change 500491 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] trackSubscriber: don't populate all fields, to make validation happy

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

I don't see the validation messages in the console, even with trackdebug=1. How do I reproduce this?

DLynch added a comment.Apr 2 2019, 2:44 PM

@matmarex: see debug.js in the EventLogging extension for more details, but basically, do this in your console:

mw.loader.using( 'mediawiki.api' ).then( function () {
    new mw.Api().saveOption( 'eventlogging-display-web', '1' );
} );

Then you'll need to actually make the event happen, which trackdebug doesn't do (in fact, it suppresses the actual event to avoid distorting the sample with debug actions). If you install the WikimediaEvents extension, you can then stick $wgWMESchemaEditAttemptStepSamplingRate = 1; into a config file and it'll just log everything.

Change 500491 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] trackSubscriber: don't populate all fields, to make validation happy

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

ppelberg closed this task as Resolved.May 24 2019, 11:12 PM

Change 515235 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/MobileFrontend@master] Apply EditAttemptStep validation tweaks

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

Looking at it... I think we've just always been pouring all of these in, and letting the schema accept the ones it knows about. I believe that it just discards the unknown properties, rather than the entire event in those cases, right? [..]

EventLogging discards invalid events, and it uses the same logic as the validation that EventLogging's debug mode performs in the browser.

See https://logstash.wikimedia.org/goto/0dcde09a5b2da057fffedbd0773bd3ca for timeline of these with samples of discarded events.

Change 515235 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Apply EditAttemptStep validation tweaks

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

Change 515867 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/MobileFrontend@master] schemaEditAttemptStep: fix variable name in code from VE

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

Change 515867 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] schemaEditAttemptStep: fix variable name in code from VE

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