NOTE: This bug report is a WIP and isn't ready for prime time. Any help debugging is appreciated!
== Summary
Despite being in a ready state, the `ext.eventLogging.subscriber` module isn't being executed and so events logged via [[ https://github.com/wikimedia/mediawiki-extensions-EventLogging/blob/807040b63f70457a7914d654897ce3ff47afef5c/modules/ext.eventLogging.subscriber.js#L97 | the subscriber protocol ]] aren't being logged.
== Background
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}, @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
```lang=js
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
1. ~~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.