Closed Bug 1709492 Opened 3 years ago Closed 3 years ago

CardDAV OAuth2 token expires and is not refreshed

Categories

(MailNews Core :: Address Book, defect)

defect

Tracking

(thunderbird_esr78 fixed, thunderbird89 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
thunderbird_esr78 --- fixed
thunderbird89 --- fixed

People

(Reporter: darktrojan, Assigned: darktrojan)

Details

Attachments

(1 file)

Google's OAuth tokens expire after an hour. Every synchronisation after that we get an authorisation error.

Here we call oauth.connect with the refresh argument false.

connect just calls aSuccess() immediately because there is a token (though it's expired) and we didn't ask for it to be refreshed. I think we should check the expiry here and skip to the next block which refreshes the token. I also notice there's several branches of connect which don't call either success or failure callback. That seems dodgy. Scratch that, I overlooked something.

Target Milestone: --- → 90 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/86b7fd0621bc
Automatically refresh expired OAuth2 tokens when they are next used. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9220240 [details]
Bug 1709492 - Automatically refresh expired OAuth2 tokens when they are next used. r?mkmelin

[Approval Request Comment]
Regression caused by (bug #): Never worked.
User impact if declined: Some CardDAV directories stop syncing after a time until Thunderbird is restarted.
Testing completed (on c-c, etc.): Just landed.
Risk to taking this patch (and alternatives if risky): Small.

Attachment #9220240 - Flags: approval-comm-beta?

Comment on attachment 9220240 [details]
Bug 1709492 - Automatically refresh expired OAuth2 tokens when they are next used. r?mkmelin

[Triage Comment]
Approved for beta

Attachment #9220240 - Flags: approval-comm-beta? → approval-comm-beta+

Uplift to 78?

Comment on attachment 9220240 [details]
Bug 1709492 - Automatically refresh expired OAuth2 tokens when they are next used. r?mkmelin

[Approval Request Comment]
Regression caused by (bug #): Never worked.
User impact if declined: Some CardDAV directories stop syncing after a time until Thunderbird is restarted.
Testing completed (on c-c, etc.): In b4.
Risk to taking this patch (and alternatives if risky): Small.

Attachment #9220240 - Flags: approval-comm-esr78?

Comment on attachment 9220240 [details]
Bug 1709492 - Automatically refresh expired OAuth2 tokens when they are next used. r?mkmelin

[Triage Comment]
Approved for esr78

Attachment #9220240 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: