Closed Bug 1772390 Opened 2 years ago Closed 2 years ago

imServices.jsm should not export Services

Categories

(Chat Core :: General, task)

Tracking

(thunderbird_esr102 fixed, thunderbird102 wontfix)

RESOLVED FIXED
103 Branch
Tracking Status
thunderbird_esr102 --- fixed
thunderbird102 --- wontfix

People

(Reporter: mkmelin, Assigned: mkmelin)

Details

Attachments

(2 files)

imServices.jsm builds on to the normal Services instead of only exporting an object with the IM specific services.
This is a bit of a mess, and the mess will grow further during the ESMification effort, like bug 1772313 and related linting...

imServices.jsm should instead export something like IMServices, and the callers that import imServices.jsm but use it for Services.jsm should be split out to call that instead.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Component: Instant Messaging → General
Product: Thunderbird → Chat Core
Version: unspecified → trunk

Yeah, but modules are supposed to be Capitalized, so that it's clear what is a "normal" variable and what is not.
I'll take the opportunity to capitalize the file name as well. (IMServices.jsm)

  • Make imServices.jsm export IMServices
  • hg mv ./chat/modules/imServices.jsm ./chat/modules/IMServices.js
  • global rewrite
    grep --exclude-dir=.hg --exclude-dir=suite -rl '{ Services } = ChromeUtils.import("resource:///modules/imServices.jsm");' | xargs sed -i -E 's#(var|const) { Services } = ChromeUtils.import("resource:///modules/imServices.jsm");#\1 { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");\1 { IMServices } = ChromeUtils.import("resource:///modules/IMServices.jsm");#g'
  • Fix stray cases of imServices.jsm imported as something else
  • rewrite callers
    grep --exclude-dir=.hg --exclude-dir=suite -rEl "\b(Services.accounts.|Services.core.|Services.cmd.|Services.contacts|Services.conversations|Services.tags.|Services.logs.)" | xargs sed -i -E 's/\b(Services.accounts.|Services.core.|Services.cmd.|Services.contacts|Services.conversations|Services.tags.|Services.logs.)/IM\1/g'
  • linting

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4bbe7e059e02
imServices.jsm should not export Services. r=freaktechnik

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/91c8e5227140
followup - Use correct accounts service in OTR. r=#thunderbird-reviewers,mkmelin

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED

Rob, if you're doing bug 1783250 this is likely needed as well.

Flags: needinfo?(rob)

Comment on attachment 9279592 [details]
Bug 1772390 - imServices.jsm should not export Services. r=freaktechnik

[Triage Comment]
Per Magnus this is needed to prevent future uplift issues.

Flags: needinfo?(rob)
Attachment #9279592 - Flags: approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: