Page MenuHomePhabricator

Duplicate Events Generated when Interacting with Radio Buttons
Closed, ResolvedPublic1 Estimated Story Points

Description

From T351298

Major: When I interact with a radio button, I see two identical events being submitted one after the other (with < 1 ms gap between submissions).

Expected Behavior:
The expected behavior is that a single event should be generated when interacting with the client preferences sidebar radio button. Duplicate events with an extremely small time gap between submissions should not occur.

Actual Behavior:
Two identical events are being submitted in rapid succession (< 1 ms gap) when interacting with a radio button.

QA

Make sure only a single event.action="click" event is firing per radio button click in the Client Preferences Sidebar

Event Timeline

Assuming this is about the #wikimediaevents codebase (if not, please correct). Please set code project tags when possible - thanks! :)

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

[mediawiki/skins/Vector@master] Stop duplicate events from firing

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

Change 977811 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/WikimediaEvents@master] Test: Duplicate Events Generated when Interacting with Radio Buttons

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

@KSarabia-WMF I've isolated this via a test case above.

Update: I'm now not convinced I have.. will look at this again tomorrow. Either way I suggest we capture this in a test case to understand it better.

Change 977808 abandoned by Kimberly Sarabia:

[mediawiki/skins/Vector@master] Stop duplicate events from firing

Reason:

See Change-Id: I8c01ccbbc83100d5c7d00e1dcdb798f382822a79

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

Clicking the label, triggers two events on <label class="cdx-radio__label" for="vector-client-pref-vector-feature-limited-width-value-1">Standard</label> and then <input name="vector-client-pref-vector-feature-limited-width-group" id="vector-client-pref-vector-feature-limited-width-value-1" type="radio" value="1" class="cdx-radio__input"> - both have the parent data-event-name.

Easiest possible option is to move the data-event-name to the input element. To prevent us running into this again, we should update our click tracking to only allow data-event-name on leaf nodes.

Change 978113 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Fixes: Duplicate events for radio buttons

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

Change 978113 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Fixes: Duplicate events for radio buttons

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

Change 978071 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@wmf/1.42.0-wmf.7] Fixes: Duplicate events for radio buttons

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

Change 978072 had a related patch set uploaded (by Urbanecm; author: Jdlrobson):

[mediawiki/skins/Vector@wmf/1.42.0-wmf.5] Fixes: Duplicate events for radio buttons

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

Change 978071 merged by jenkins-bot:

[mediawiki/skins/Vector@wmf/1.42.0-wmf.7] Fixes: Duplicate events for radio buttons

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

Change 978072 merged by jenkins-bot:

[mediawiki/skins/Vector@wmf/1.42.0-wmf.5] Fixes: Duplicate events for radio buttons

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

Mentioned in SAL (#wikimedia-operations) [2023-11-28T21:59:26Z] <urbanecm@deploy2002> Started scap: Backport for [[gerrit:978072|Fixes: Duplicate events for radio buttons (T352075)]], [[gerrit:978071|Fixes: Duplicate events for radio buttons (T352075)]], [[gerrit:978067|Work around Parsoid's messy handling of some extensions (T351461)]]

Mentioned in SAL (#wikimedia-operations) [2023-11-28T22:01:04Z] <urbanecm@deploy2002> urbanecm and ssastry and jdlrobson: Backport for [[gerrit:978072|Fixes: Duplicate events for radio buttons (T352075)]], [[gerrit:978071|Fixes: Duplicate events for radio buttons (T352075)]], [[gerrit:978067|Work around Parsoid's messy handling of some extensions (T351461)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2023-11-28T22:12:29Z] <urbanecm@deploy2002> Finished scap: Backport for [[gerrit:978072|Fixes: Duplicate events for radio buttons (T352075)]], [[gerrit:978071|Fixes: Duplicate events for radio buttons (T352075)]], [[gerrit:978067|Work around Parsoid's messy handling of some extensions (T351461)]] (duration: 13m 02s)

Change 978158 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/WikimediaEvents@master] Limit click tracking to buttons, anchors and inputs

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

Jdlrobson lowered the priority of this task from High to Medium.
Jdlrobson added a subscriber: Edtadros.

This has been backported now so dropped priority.
I posted patches to fix this in a more general way. Let's QA after those are done.

we'd like @phuedx to take a look at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/977811/ which is introducing tests and refactoring the existing code.

Done. Let me know if you want to talk about my review further ✌

As discussed in standup yesterday, we're waiting on review from @phuedx so this is likely to carry over to new sprint (but is mostly done - we can re-estimated if needed!)
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/977811/

Actually, I've just gone ahead and done that. We'll continue this work in T352566 next sprint. I'll go ahead and QA this one now...

Test Result - Beta

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

Only one event seen.

Screenshot 2023-12-01 at 10.29.42 AM.png (220×424 px, 23 KB)

Kim could you sign off the duplicate bug?