Closed Bug 1868194 Opened 2 years ago Closed 2 years ago

Convert TelemetryFeed.jsm into an ESM

Categories

(Firefox :: New Tab Page, task, P3)

Desktop
All
task

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Regressed 1 open bug)

Details

(Whiteboard: [esmification-timeline])

Attachments

(4 files)

TelemetryFeed uses the injection system in its unit test which is incompatible with ESMs. This means that prior to converting the module, we must convert TelemetryFeed.test.js into an xpcshell test. This bug covers doing both things.

Severity: -- → S3
OS: Unspecified → All
Priority: -- → P3
Hardware: Unspecified → Desktop

Prior to this patch, we would add preference observers during TelemetryFeed.init,
but never remove them on uninit. In the common case, a TelemetryFeed is only ever
created once, so this is mostly fine - but in rare cases (for example, a user chooses
to disable and re-enable TelemetryFeed multiple times via prefs) or in automated
testing (where we create, init and destroy many instances of TelemetryFeed), failing
to remove preference observers means that we keep the feed alive even after its
uninitted, and also continue to have it react to preference changes.

Attachment #9371182 - Attachment description: WIP: Bug 1868194 - TelemetryFeed.uninit should unregister all preference observers. r?thecount! → Bug 1868194 - TelemetryFeed.uninit should unregister all preference observers. r?thecount!
Attachment #9371183 - Attachment description: WIP: Bug 1868194 - Convert some PingCentre ping schema tests from joi to JSON schema. r?thecount! → Bug 1868194 - Convert some PingCentre ping schema tests from joi to JSON schema. r?thecount!
Attachment #9371184 - Attachment description: WIP: Bug 1868194 - Convert TelemetryFeed.test.js to an xpcshell test. r?thecount! → Bug 1868194 - Convert TelemetryFeed.test.js to an xpcshell test. r?thecount!
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/13c3b418aaed TelemetryFeed.uninit should unregister all preference observers. r=thecount https://hg.mozilla.org/integration/autoland/rev/d2435c55c2d5 Convert some PingCentre ping schema tests from joi to JSON schema. r=thecount https://hg.mozilla.org/integration/autoland/rev/81d8db80d8ac Convert TelemetryFeed.test.js to an xpcshell test. r=thecount https://hg.mozilla.org/integration/autoland/rev/cb76a44a3e41 Convert TelemetryFeed.jsm to an ESM. r=thecount
Regressions: 1875918
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: