Closed Bug 1706355 Opened 2 months ago Closed 19 days ago

Download telemetry for added downloads is possibly inflated

Categories

(Firefox :: Downloads Panel, defect, P2)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: Gijs, Assigned: ava8katushka)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We instrumented the number of downloads in bug 1627676. We did this via the onDownloadAdded handler in DownloadsCommon.jsm.

When I looked at this code this morning for bug 1685737, my impression was that this code runs at every startup, for all items in the downloads history - at least the failed ones that are persisted (cf bug 1685737). This means that the numbers may be artificially inflated.

I actually thought that this applied to all downloads, but I think we might only do this for unsuccessful downloads - I don't see the telemetry on my regular profile (without any unsuccessful downloads) after a restart. Marco, can you help by clarifying when this handler is supposed to get invoked?

I'm worried that this might skew our downloads stats.

Flags: needinfo?(mak)

This onDownloadAdded event handler is part of DownloadsDataCtor that is used by various Data objects that basically generate lists of downloads. There are multiple lists of downloads in the product, just that is likely to cause over-counting, and in addition it is also accounting repeated failures as you pointed out.
A Data object is a view over List, and there can be multiple views, thus it's not a good place to track unique downloads.
A better place may be DownloadCombinedList.onDownloadAdded, that should be invoked by private and public Lists when a new public or private download is added. You should still skip downloads that failed to avoid double counting the ones re-added... maybe it would be enough to skip downloads having .stopped? Or you could pass something here to tell "hey we are adding this download from the previous session" https://searchfox.org/mozilla-central/rev/b6f52976b562008c9d9ceeda22907e1eda506c8e/toolkit/components/downloads/DownloadStore.jsm#122

Flags: needinfo?(mak)

Hi Romain, would you be able to help determine a priority for this?

Flags: needinfo?(rtestard)

This is not Proton related. I don't think this is particularly urgent though it would be nice to fix it post proton since we'll look into download experience changes soon and measuring the impact of the chance will be good to have.

Flags: needinfo?(rtestard)
Priority: -- → P2
Severity: -- → S3
Assignee: nobody → ava8katushka
Status: NEW → ASSIGNED
Attachment #9223196 - Attachment description: WIP: Bug 1706355 - Move recording new download to telemetry from DownloadsCommon to DownloadsList for more accurate download count → Bug 1706355 - Move recording new download to telemetry from DownloadsCommon to DownloadsList for more accurate download count
Attachment #9223196 - Attachment description: Bug 1706355 - Move recording new download to telemetry from DownloadsCommon to DownloadsList for more accurate download count → WIP: Bug 1706355 - Move recording new download to telemetry from DownloadsCommon to DownloadsList for more accurate download count
Attachment #9223196 - Attachment description: WIP: Bug 1706355 - Move recording new download to telemetry from DownloadsCommon to DownloadsList for more accurate download count → Bug 1706355 - Move recording new download to telemetry from DownloadsCommon to DownloadsList for more accurate download count
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/ffd2f7c0f1a4
Move recording new download to telemetry from DownloadsCommon to DownloadsList for more accurate download count r=Gijs,mak
Status: ASSIGNED → RESOLVED
Closed: 19 days ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
No longer regressions: 1714020
You need to log in before you can comment on or make changes to this bug.