"first-shutdown" ping is being sent way too often and at the wrong times.
Categories
(Toolkit :: Telemetry, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox83 | --- | fixed |
People
(Reporter: chutten|RustWeek, Assigned: chutten|RustWeek)
References
Details
(Whiteboard: [dataquality])
Attachments
(1 file)
"first-shutdown" pings are supposed to be sent on the first session of a Firefox Desktop profile when it shuts down. This can be verified by the session and subsession info:
payload.info.previousSessionIdshould be absent because there's been no previous session.payload.info.subsessionCountershould equalpayload.info.profileSubsessionCounter. The latter is a persisted monotonically-increasing sequence counter. The former is a counter just for this session. The only time they should agree is on the first session.
The proportion of "first-shutdown" pings for which either of those two conditions do not hold is about 53% suggesting that over half of "first-shutdown" pings are not from the first session after all.
Context:
"first-shutdown" pings are clones of the "main" ping with reason "shutdown" that otherwise would be sent on the first session's shutdown, with two small differences:
- It is sent using pingsender immediately on that session's shutdown
- It has the type "first-shutdown", not "main"
Back in the pre-pingsender days we would receive no "main" pings with reason "shutdown" from single-session profiles. When introducing pingsender for sending "main" pings with reason "shutdown" we wanted to avoid a spike in our Active User counts caused by suddenly counting single-session profiles as Active Users. We did this by leaving the "main" ping with reason "shutdown" to still be sent the traditional non-pingsender way on the second session, but first we clone it, call it "first-shutdown", and send it via pingsender immediately on that first session's shutdown.
Theory:
To detect whether it is the first session or not, the "first-shutdown" ping logic asks TelemetryReportingPolicy if it is the first run of this profile. This is fairly sensible as TRP needs to calculate whether it's the first run or not to determine if it should show the Privacy Notice to the user and prevent sending Telemetry for a while.
However, TelemetryReportingPolicy doesn't actually check if it's the first run until sessionrestore-windows-restored has been observed meaning if the "first-shutdown" ping logic runs before sessionrestore-windows-restored it will get the default value for isFirstRun, which is true.
Effect:
This means any session that shuts down before sessionrestore-windows-restored will send a "first-shutdown" ping. The number of "first-shutdown" pings will be wildly inflated, probably overrepresented by clients whose Firefox do not start up rapidly (delaying sessionrestore-windows-restored).
This also means that any session that shuts down before sessionrestore-windows-restored will also not send a "main" ping with reason "shutdown" until the next session. This will introduce a delay in Active User counts that depend on "main" pings and interfere with "last session" analyses (because in users whose last session shuts down before sessionrestore-windows-restored, we will not receive a "main" ping).
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
Previously it would wait until sessionrestore-windows-restored before
checking the pref. Now it'll check the pref the first time someone asks.
Comment 3•5 years ago
|
||
| bugherder | ||
Updated•3 years ago
|
Description
•