Despite being in a ready state, the ext.eventLogging.subscriber module isn't being executed and so events logged via the subscriber protocol aren't being logged.
Background
tl;dr: https://www.youtube.com/watch?v=KkgUhV4gvno
The Page Previews (PP) A/B test on enwiki defines three buckets. The on bucket contains 3% of all anonymous users. Those users receive the PP experience with its instrumentation turned on. While pairing on T175377: [Spike 4hrs] Verify EventLogging instrumentation/bucketing for the enwiki/dewiki A/B test, @Tbayer and I noticed that PP wasn't logging events on every pageview when I manipulated my way into the on bucket. There didn't seem to be any obvious differences between those pages where PP did and did not log events.
For those pages that did log events, we know that:
- The ext.eventLogging.subscriber is in the ready state and loaded from Local Storage.
- PP is trying to send events using the subscriber protocol.
- We verified this by executing
mw.trackSubscribe( 'event.', ( topic, data ) => console.log( topic, JSON.stringify( data, null, 2 ) ) );
Browsers Affected
I've tested and confirmed this in:
- Chrome (60.0.3112.113) on macOS Sierra (10.12.6)
- Firefox (54.0.1) on macOS Sierra (10.12.6)
Hypotheses
The ext.eventLogging.subscriber module script is being executed some time (a long time) after the PP module script.
@phuedx: mw.track stores messages in an in-memory data structure to guarantee that late subscribers are delivered all messages that have been sent by one or more producers.
QA Notes
- Navigate to https://en.wikipedia.beta.wmflabs.org/wiki/Special:AllPages.
- Log out, if necessary.
- Ensure that you're in the on/control Page Previews A/B test bucket. Use the below handy snippet:
(function () { var experimentGroupSize = mw.config.get( 'wgPopupsAnonsExperimentalGroupSize' ), control = experimentGroupSize / 2; console.log(mw.experiments.getBucket( { name: 'ext.Popups.visibility', enabled: true, buckets: { off: 1 - experimentGroupSize, control: control, on: control } }, mw.user.sessionId() )); }());
- Observe that a pageLoaded Popups EL event is logged.
- Interact with a link
- Observe that another Popups EL event is logged.
- Navigate to another page.
- Observe that a pageLoaded Popups EL event is logged.
- Interact with a link.
- Observe that another Popups EL event is logged.
Repeat steps 7-10 a couple of times to prove that the subscriber is always being subscribed.