Page MenuHomePhabricator

[Bug] Donor Badge: Remove client prefs for control group
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

If mw.user.clientPrefs.set( 'minerva-badge', '1' ) happens to be set, a user bucketed in the the control group will see the donor badge.

Steps to reproduce

  • Run mw.user.clientPrefs.set( 'minerva-badge', '1' ); in the console
  • add mpo=donor-delight-badge:control to the URL
  • notice the donor badge is present

Requirements

Recent donors in control group will not see the donor badge

Acceptance criteria

  • mw.user.clientPrefs.set( 'minerva-badge', 'disabled' ) is set for users in control group

BDD

Feature: Donor badge suppressed for control group

  Scenario: Control group overrides a set minerva-badge pref
    Given I am a logged-out donor on mobile web (Minerva)
    And mw.user.clientPrefs.set( 'minerva-badge', '1' ) has been set
    When I am bucketed into the control group (mpo=donor-delight-badge:control)
    Then the resolved client preference is minerva-badge-clientpref-disabled
    And the donor badge is not visible

Test Plan

Test Case 1: Control overrides minerva-badge pref (ticket repro)
On beta, mobile/Minerva, logged out: set donor cookie, mw.user.clientPrefs.set('minerva-badge','1'),
mw.testKitchen.overrideExperimentGroup('donor-delight-badge','control'); reload; inspect html class + badge.
AC1: html resolves to minerva-badge-clientpref-disabled (NOT -1) for control group.
AC2: The donor badge is not visible (.minerva-badge-container display:none, width 0).

Test Results

ACStatusDetails for test run T428501#12008042
1pref set to '1' + control bucket resolves to html minerva-badge-clientpref-disabled (prefIs1=false) — see T428501_beta_AC1_1.png
2badge hidden in control: .minerva-icon--badge present in DOM but container display:none, width 0

Event Timeline

Change #1298884 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/extensions/WikimediaCustomizations@master] [Bug] Donor Badge: Remove client prefs for control group

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

LMora-WMF set the point value for this task to 1.Jun 8 2026, 7:33 PM

Change #1298884 abandoned by LorenMora:

[mediawiki/extensions/WikimediaCustomizations@master] [Bug] Donor Badge: Remove client prefs for control group

Reason:

I tested this css change and saw that it worked but abandoning as I believe Jon will look into a 1 patch fix for this and another issue

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

Jdlrobson-WMF lowered the priority of this task from High to Medium.Jun 8 2026, 11:16 PM
Jdlrobson-WMF subscribed.

I believe this has been addressed by the other tasks. Note, because of the way we bucket the mpo parameter is only going to work on the first URL. I'd prefer not to prioritize this if we can. There may be benefits from QA that make this worthwhile but given we are so close to the experiment enablement date I think it's worth pausing and deciding if the effort here matches the reward.

Let's talk in standup.

I believe this has been addressed by the other tasks.

Has it? I'm still seeing the badge in the control group. I thought we were going to go with the CSS-only solution in the now abandoned patch.

Has it? I'm still seeing the badge in the control group. I thought we were going to go with the CSS-only solution in the now abandoned patch.

Let's talk in standup. Our experiment has side effects - we need JS to detect donation status and enable the badge.

The display of the badge in control is only possible if the user donated and then switched groups mid-experiment from say delightful to control.
If they can do that, this would be very concerning and we should think carefully about 1) whether it's possible 2) how to handle it 3) whether we need to do anything other than hide the badge (we might want to stop logging events for these users too)

Change #1298884 restored by LorenMora:

[mediawiki/extensions/WikimediaCustomizations@master] [Bug] Donor Badge: Remove client prefs for control group

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

Change #1299639 had a related patch set uploaded (by Jdlrobson; author: LorenMora):

[mediawiki/extensions/WikimediaCustomizations@wmf/1.47.0-wmf.6] [Bug] Donor Badge: Remove client prefs for control group

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

Change #1298884 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCustomizations@master] [Bug] Donor Badge: Remove client prefs for control group

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

Change #1299639 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCustomizations@wmf/1.47.0-wmf.6] [Bug] Donor Badge: Remove client prefs for control group

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

Mentioned in SAL (#wikimedia-operations) [2026-06-09T21:54:50Z] <jdlrobson@deploy1003> Started scap sync-world: Backport for [[gerrit:1299639|[Bug] Donor Badge: Remove client prefs for control group (T428501)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-09T21:56:54Z] <jdlrobson@deploy1003> jdlrobson: Backport for [[gerrit:1299639|[Bug] Donor Badge: Remove client prefs for control group (T428501)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-09T22:15:47Z] <jdlrobson@deploy1003> Finished scap sync-world: Backport for [[gerrit:1299639|[Bug] Donor Badge: Remove client prefs for control group (T428501)]] (duration: 20m 57s)

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: beta — en.wikipedia.beta.wmcloud.org/wiki/Paris (mobile/Minerva, logged out)
OS: macOS Tahoe 26.x
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: iPhone 17 Pro Max

Setup (ticket repro): donor cookie centralnotice_hide_fundraising {reason:"donate"}; mw.user.clientPrefs.set('minerva-badge','1'); mw.testKitchen.overrideExperimentGroup('donor-delight-badge','control'); reload.

Test Case 1: Control overrides minerva-badge pref
✅ AC1: Despite minerva-badge being set to '1', the control bucket resolves the html class to minerva-badge-clientpref-disabled (not minerva-badge-clientpref-1). Confirms the control group forces the minerva-badge client preference to 'disabled' per the AC.
✅ AC2: The badge does not render — .minerva-icon--badge exists in the DOM but its container is display:none (width 0). html also carries the prefixed ext-wc-donor-badge-control class.

T428501_beta_AC1_1.png (1,395×1,508 px, 581 KB)

Volker_E removed a project: Patch-For-Review.
Volker_E updated the task description. (Show Details)