Closed Bug 2048069 Opened 4 months ago Closed 4 months ago

Update Thundermail system add-on to match AccountHub API experiment

Categories

(Thunderbird :: Build Config, enhancement)

enhancement

Tracking

(thunderbird153 fixed)

RESOLVED FIXED
154 Branch
Tracking Status
thunderbird153 --- fixed

People

(Reporter: aaspinwall, Assigned: aaspinwall)

References

Details

Attachments

(1 external file, 2 obsolete files)

Describe the bug

The AccountHub experiment API — which logs the add-on in automatically when a Thundermail account is added through Thunderbird's Accounts Hub — stopped working. Adding a Thundermail account no longer signs the add-on in.

Root cause: two upstream Thunderbird API changes the experiment code was never updated for:

  1. nsIMsgIncomingServer renamed its hostName property to hostname (lowercase). The listener read server.hostName, which now returns undefined, so the Thundermail host regex never matched and onServerLoaded returned early on every account.
  2. OAuth2Module.getRefreshToken() became async. It was called without await, so a Promise (always truthy) was fired across the experiment→background boundary instead of the refresh-token string.

To Reproduce

Steps to reproduce the behavior:

  1. Run a recent Thunderbird (140+, where the upstream API changes landed).
  2. Open the Accounts Hub and add a Thundermail account (mail.thundermail.com / mail.stage-thundermail.com).
  3. Complete the OAuth login for the mail account.
  4. See error: the add-on never logs in (silent failure in the Error Console).

Expected behavior

After adding a Thundermail account via the Accounts Hub, the add-on logs in automatically: onAccountAdded fires with a valid refresh token, the token is stored against the mail account, and the Add-On → Web login flow runs.

Actual behavior

Nothing happens — the add-on stays logged out. The onServerLoaded handler returns early because server.hostName is undefined (/thundermail\.com$/i.test(undefined) is false). Even past that gate, getRefreshToken() returned a Promise instead of the token string, so the wrong value would have been dispatched. No exception is thrown; the failure is entirely silent.

Screenshots

N/A

System

  • OS: macOS (Darwin 25.5.0)
  • Browser Version: Thunderbird 140–155

Additional context

Verified against the Thunderbird source: OAuth2Module.getRefreshToken() is declared async in OAuth2Module.sys.mjs, and nsIMsgIncomingServer.idl declares attribute AUTF8String hostname; with no hostName variant. The copy of this add-on bundled in the Thunderbird tree is a stale snapshot carrying the same two bugs.

Assignee: nobody → aaspinwall
Status: NEW → ASSIGNED
Attachment #9598346 - Attachment description: Bug 2048069 - update account hub experiment for system addon. r=#thunderbuild → Bug 2048069 - Update Thundermail system add-on to 1.9.0; await OAuth2 refresh token on server load. r=#thunderbuild

Comment on attachment 9598346 [details]
Bug 2048069 - Update Thundermail system add-on to 1.9.0; await OAuth2 refresh token on server load. r=#thunderbuild

Uplift Approval Request

  • Please state case for uplift consideration and ensure bug severity is set: The patch contains minimal changes only targeted for the add-on to work properly
  • User impact if declined:
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Daily?: Yes
  • Has the fix been verified in Beta?: No
  • Needs manual test from QA?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): not risky as it doesn't affect main functionality
  • Does the fix cause any migrations to be skipped?: No
  • String changes made/needed:
Attachment #9598346 - Flags: approval-comm-beta?

Comment on attachment 9598346 [details]
Bug 2048069 - Update Thundermail system add-on to 1.9.0; await OAuth2 refresh token on server load. r=#thunderbuild

[Triage Comment]
Approved for beta

Attachment #9598346 - Flags: approval-comm-beta? → approval-comm-beta+
Target Milestone: --- → 154 Branch

Pushed by corey@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/b6a623d00fb0
Update Thundermail system add-on to 1.9.0; await OAuth2 refresh token on server load. r=coreycb

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Regressions: 2048823
Attachment #9598466 - Attachment is obsolete: true
Attachment #9598082 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: