Closed Bug 2060320 Opened 2 months ago Closed 2 months ago

Fix `newtab.closed` and `newtab.sections_impression` firing unexpectedly

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: joelkelly, Assigned: joelkelly)

References

(Blocks 1 open bug)

Details

(Whiteboard: [hnt][hnt-journeys])

Attachments

(3 files)

Stop emitting these events when a link is opened in a new window or tab via the topsite menu, content menu, or weather right-click.

Affected actions:

  • open topsite/content menu -> new window
  • right click topsite/content -> new tab
  • right click weather -> new window

Jira: https://mozilla-hub.atlassian.net/browse/HNT-2027

#eventBuffer is a single instance-level buffer shared by every newtab
session, and it is only drained by #clearEventBuffer, which today runs
from endSession() and transitionToPrivateSession(). Sessions still open
when the feed goes away never receive a NEW_TAB_UNLOAD, so they never
call endSession and everything they queued is dropped: uninit() discarded
the buffer without sending it.

Assignee: nobody → joelkelly
Status: NEW → ASSIGNED

endSession() recorded newtab.closed, drained the shared event buffer and
submitted the newtab ping before it checked whether the session had ever
been visible. The never-shown guard sat about 35 lines further down, so
it only ever suppressed the session_duration bookkeeping: hidden preloaded
newtabs still produced a full newtab_session_end ping carrying a
newtab.closed event for a visit the user never saw.

Attachment #9621854 - Attachment description: Bug 2060320 - Flush buffered newtab events at TelemetryFeed shutdown r?#home-newtab-reviewers,thecount → WIP: Bug 2060320 - Flush buffered newtab events at TelemetryFeed shutdown r?#home-newtab-reviewers,thecount
Attachment #9621855 - Attachment description: Bug 2060320 - Don't report newtab sessions the user never saw r?#home-newtab-reviewers,thecount → WIP: Bug 2060320 - Don't report newtab sessions the user never saw r?#home-newtab-reviewers,thecount

Every concurrent newtab session shares one event buffer, and its entries
carry no session identity. Whichever session ends first drains and reports
the events queued by all the others, in a ping that describes the wrong
session.

Tag each queued event with the session that recorded it, and drain only that
session's events. The tag routes events and is never reported, so the data is
unchanged.

Attachment #9621854 - Attachment description: WIP: Bug 2060320 - Flush buffered newtab events at TelemetryFeed shutdown r?#home-newtab-reviewers,thecount → Bug 2060320 - Flush buffered newtab events at TelemetryFeed shutdown r?#home-newtab-reviewers,thecount
Attachment #9621855 - Attachment description: WIP: Bug 2060320 - Don't report newtab sessions the user never saw r?#home-newtab-reviewers,thecount → Bug 2060320 - Don't report newtab sessions the user never saw r?#home-newtab-reviewers,thecount
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: