ReadingDepth refactor - exit early for incompatible browsers
Closed, ResolvedPublic3 Story Points

Description

During code-review of 443569 , some potential performance optimizations to the ReadingDepth.js code were identified. See: https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/WikimediaEvents/+/443569/6/modules/all/ext.wikimediaEvents.readingDepth.js@271

Specifically, it would be beneficial to exit the function early when a browser don't support event-logging (or sendBeacon specifically). That would avoid unnecessarily accessing localStorage to get the value of mw.user.sessionId. To achieve this, some logic should be factored out to check for browser-compatibility first, before deciding whether to enable the logging.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 22 2018, 11:56 AM

Change 444600 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/WikimediaEvents@master] Refactor readingDepth to exit early for incompatible browsers

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

Jdlrobson added a subscriber: jan.

Thanks @jan!!

Jdlrobson triaged this task as High priority.Aug 22 2018, 3:10 PM

This is blocking review on T201124 so pulling in. Have kicked off an async estimation.

Jdlrobson set the point value for this task to 3.Aug 22 2018, 5:14 PM

We settled on a 3 here given testing risk required to ensure ReadingDepth is working as expected.

Change 444600 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEvents@master] Refactor readingDepth to exit early for incompatible browsers

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

Jdlrobson closed this task as Resolved.Aug 22 2018, 7:07 PM

QA will be handled in T191532?

Krinkle awarded a token.
Krinkle moved this task from Limbo to Watching on the Performance-Team (Radar) board.