Crossword widget double-counts actions and includes too many catch-all "interaction" user_actions
Categories
(Firefox :: New Tab Page, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: ameryman, Assigned: rhamoui)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
This is a report from Claude, below! I am seeing a ton of "interaction" user_actionsn for the crossword widget, and this is what Claude found and recorded. I believe there are 3 separate issues here, likely with different severity and scope, so we can split out as needed!
The Crossword widget's telemetry diverges from every other New Tab widget in a way that both inflates event counts and makes the data hard to analyze. Regressed by bug 2053311.
1. Context menu actions are recorded twice.
handleMenuAction (Crossword.jsx:264) dispatches a WIDGETS_USER_EVENT with user_action: "menu_action" and posts a menu_action command into the Particle iframe. The iframe independently emits its own interaction event for the same user action, which handleWidgetEvent (Crossword.jsx:210) turns into a second WIDGETS_USER_EVENT.
Verified against the live bundle served from prod-games-particle.merino.prod.webservices.mozgcp.net:
- "Show clues" -> Firefox
menu_action/show_all_clues+ iframeinteraction/all_clues_opened(entry: "context_menu") = 2 events - "Solve puzzle" -> Firefox
menu_action/reveal_grid+ iframeinteraction/reveal_grid_requested+interaction/reveal_grid_completed= 3 events
puzzle_completed is not affected; the bundle emits it through a separate marker-deduped path.
2. Every keystroke is a Glean event.
The bundle calls its emitInteraction helper on input_letter (per letter typed), backspace (per press), and cell_click (per cell selected). Each becomes a widgets_user_event in the newtab ping. One completed 15x15 puzzle generates hundreds of records, which will swamp widgets_user_event volume and make cross-widget engagement comparisons meaningless without special-casing crossword out of every query.
3. The user_action key is a catch-all, unlike every other widget.
Crossword.jsx is the only widget that sends a constant literal in user_action - both "interaction" (line 218) and "menu_action" (line 274) - with the real action pushed down into action_value. Every other widget puts the semantic action in user_action directly (learn_more, change_size, timer_play, list_copy), which is what the widgets_user_event description in metrics.yaml documents. Any dashboard grouping by user_action gets one opaque "interaction" bucket for crossword and correctly-labelled actions for everything else.
Related: EVENT_PAYLOAD_VALIDATORS[INTERACTION] only checks typeof payload.action === "string" with no allowlist, so the remotely-hosted bundle can introduce new action_value strings into the newtab ping at any time without a Firefox-side change or data review.
Suggested fix:
- Drop the
menu_actiondispatch inhandleMenuAction, or have the iframe suppress itsinteractionemission for host-originated commands - one owner per action. - Filter inbound
interactionevents to a meaningful allowlist (play_started,hint_revealed,reveal_grid_completed,related_article_clicked) and drop the per-keystroke ones (input_letter,backspace,cell_click). The interaction pref flip should stay driven by all of them; only the Glean dispatch needs gating. - Send the real action in
user_actionto match the other widgets, and migrate Crossword onto the shareduseWidgetTelemetryhook.
Not affected: the widgets.crossword.interaction pref (New badge dismissal) works correctly - it is flipped on all real interaction paths, correctly skipped on widget hide, and guarded against redundant SET_PREF dispatches. Existing tests cover it.
| Reporter | ||
Comment 1•2 months ago
|
||
Linking out to the Data Engineering ticket to address as we're loading events into tables for analysis, including backfill: https://mozilla-hub.atlassian.net/browse/DENG-11450
| Assignee | ||
Comment 2•2 months ago
|
||
Updated•2 months ago
|
Updated•1 month ago
|
Description
•