Closed Bug 2059741 Opened 2 months ago Closed 2 months ago

Crossword widget double-counts actions and includes too many catch-all "interaction" user_actions

Categories

(Firefox :: New Tab Page, defect, P1)

Firefox 153
defect

Tracking

()

RESOLVED FIXED
155 Branch
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 + iframe interaction/all_clues_opened (entry: "context_menu") = 2 events
  • "Solve puzzle" -> Firefox menu_action/reveal_grid + iframe interaction/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_action dispatch in handleMenuAction, or have the iframe suppress its interaction emission for host-originated commands - one owner per action.
  • Filter inbound interaction events 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_action to match the other widgets, and migrate Crossword onto the shared useWidgetTelemetry hook.

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.

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: nobody → rhamoui
Attachment #9621279 - Attachment description: WIP: Bug 2059741 - Fix crossword telemetry by filtering out iframe-based echos and double interactions. → Bug 2059741 - Fix crossword telemetry by filtering out iframe-based echos and double interactions. r=#home-newtab-reviewers
Status: NEW → ASSIGNED
Pushed by rhamoui@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6cfd4a52a500 https://hg.mozilla.org/integration/autoland/rev/cb5313a9b336 Fix crossword telemetry by filtering out iframe-based echos and double interactions. r=Dre
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: