Page MenuHomePhabricator

Inaccurate Eventlogging Data for Mobile - Font Field Issue
Closed, ResolvedPublic2 Estimated Story Points

Assigned To
Authored By
KSarabia-WMF
Oct 25 2023, 5:22 PM
Referenced Files
F41499821: screenshot 212.png
Nov 12 2023, 11:59 PM
F41499819: screenshot 211.png
Nov 12 2023, 11:59 PM
F41499817: screenshot 210.png
Nov 12 2023, 11:59 PM
F41499815: screenshot 209.png
Nov 12 2023, 11:59 PM
F41499787: screenshot 208.png
Nov 12 2023, 11:59 PM
F41499785: screenshot 207.png
Nov 12 2023, 11:59 PM
F41499782: screenshot 206.png
Nov 12 2023, 11:59 PM
F41499767: screenshot 205.png
Nov 12 2023, 11:59 PM

Description

The problem arises from the existing logic within the WikimediaEvents system, which currently fires events by querying client preferences for the vector skin but not for minerva (mobile) skin.

Here's a brief description of the problem:

In the existing code:

function getFont() {
    return mw.user.clientPrefs.get('vector-feature-custom-font-size') || '0';
}

This code checks for the presence of a <html> class named 'vector-feature-custom-font-size-clientpref-0' within Vector 2022. This approach works in the Vector 2022 skin. However, it fails to function correctly in the Minerva (mobile) skin, where a different class naming scheme is employed, specifically 'mf-font-size-clientpref-xlarge'.

The inconsistency in class naming between the vector and minerva skins is causing inaccurate event logging data for mobile users when it comes to the 'font' field. This discrepancy must be resolved to ensure that event data is reliable and uniform across both skin types.

Success Criteria Options
Option 1: Update the 'getFont()' function to account for the minerva skin's class naming scheme. Add conditional checks to determine the user's skin and fetch the appropriate class name accordingly.
Option 2: Implement a uniform class naming scheme across all skins to simplify the event logging process and ensure consistency.

Modify the WikimediaEvents logic to query client preferences for both Vector 2022 and Minerva skins, providing a comprehensive solution for accurate event logging data across all platforms.

QA Results - Beta

QA Results - Prod

Event Timeline

Change 969193 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/WikimediaEvents@master] Add a condition for minerva font size data

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

Change 969193 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Add a condition for minerva font size data

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

QA Instructions

  1. In Beta, go to Network tab, filter by 'event' and look for the Minerva/Mobile MobileWebUIActions events
  2. Check that font: regular is the default for logged out anonymous for mobile.
  3. Next, change the mobile font settings (Go to Settings), and ensure the subsequent MobileWebUIActions font: value changes accordingly. Make sure new MobileWebUiActions events are firing with updated font size.
  4. Follow same procedure for logged in

Minerva Font Size Settings:

Screenshot 2023-10-30 at 5.43.09 PM.png (520×660 px, 49 KB)

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps
Anon

In Beta, go to Network tab, filter by 'event' and look for the Minerva/Mobile MobileWebUIActions events
✅ AC1: Check that font: regular is the default for logged out anonymous for mobile.

screenshot 183.png (1×1 px, 197 KB)

✅ AC2: Next, change the mobile font settings (Go to Settings), and ensure the subsequent MobileWebUIActions font: value changes accordingly. Make sure new MobileWebUiActions events are firing with updated font size.

screenshot 182.png (1×1 px, 188 KB)
screenshot 184.png (1×1 px, 187 KB)
screenshot 185.png (1×1 px, 188 KB)
Logged In

In Beta, go to Network tab, filter by 'event' and look for the Minerva/Mobile MobileWebUIActions events
✅ AC3: Check that font: regular is the default for logged in for mobile.

screenshot 186.png (1×1 px, 211 KB)

✅ AC4: Next, change the mobile font settings (Go to Settings), and ensure the subsequent MobileWebUIActions font: value changes accordingly. Make sure new MobileWebUiActions events are firing with updated font size.

screenshot 187.png (1×1 px, 210 KB)
screenshot 188.png (1×1 px, 204 KB)
screenshot 189.png (1×1 px, 207 KB)

To sign off I ran the query:

SELECT  event.font, count(distinct event.token)
FROM event.mobilewebuiactionstracking
WHERE year = 2023
  AND event.action = 'init'
  AND ( month = 11 )
  AND wiki != 'testwiki'
GROUP BY event.font

generated the following values:

	font	_c1

1 NULL 2280
2 xlarge 158
3 regular 1898184
4 0 13384854
5 large 144
6 small 89

Are the numbers 0 and NULL expected here? I presume they might relate to the new change rolling out?

This has been reduced as of yesterday.

Query

select event.action, event.font, count(Distinct event.token) AS count_session, count(1) AS events
FROM event.mobilewebuiactionstracking
WHERE year=2023 and month=11 and day=3
GROUP BY event.action, event.font
ORDER BY event.action, event.font
LIMIT 10000
init095826
initregular9410218

@KSarabia-WMF looks like there are no new instances so I think we are good!

SELECT  event.font, count(*)
FROM event.mobilewebuiactionstracking
WHERE year = 2023
  AND event.action = 'init'
  AND ( month = 11 ) AND day = 3
  AND wiki != 'testwiki'  group by event.font

Test Result - Prod

Status: ✅ PASS
Environment: testwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps
Anon

In Beta, go to Network tab, filter by 'event' and look for the Minerva/Mobile MobileWebUIActions events
✅ AC1: Check that font: regular is the default for logged out anonymous for mobile.

screenshot 205.png (1×1 px, 203 KB)

✅ AC2: Next, change the mobile font settings (Go to Settings), and ensure the subsequent MobileWebUIActions font: value changes accordingly. Make sure new MobileWebUiActions events are firing with updated font size.

screenshot 206.png (1×1 px, 217 KB)
screenshot 207.png (1×1 px, 222 KB)
screenshot 208.png (1×1 px, 218 KB)
Logged In

In Beta, go to Network tab, filter by 'event' and look for the Minerva/Mobile MobileWebUIActions events
✅ AC3: Check that font: regular is the default for logged in for mobile.

screenshot 209.png (1×1 px, 257 KB)

✅ AC4: Next, change the mobile font settings (Go to Settings), and ensure the subsequent MobileWebUIActions font: value changes accordingly. Make sure new MobileWebUiActions events are firing with updated font size.

screenshot 210.png (1×1 px, 247 KB)
screenshot 211.png (1×1 px, 254 KB)
screenshot 212.png (1×1 px, 264 KB)