Change logic in alarms observer to return immediately if the alarm has been cancelled

RESOLVED FIXED in Firefox 48

Status

RESOLVED FIXED
3 years ago
8 months ago

People

(Reporter: bsilverberg, Assigned: bsilverberg)

Tracking

unspecified
mozilla48

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
The code currently fires the callbacks and then returns if the alarm has been cancelled. This should be changed so that if the alarm has been cancelled it just returns immediately.

The code in question can be found at https://dxr.mozilla.org/mozilla-central/source/toolkit/components/extensions/ext-alarms.js#51.

We should also attempt to write a test for this, but it may be difficult to test. The case is described as:

"It essentially requires setting an alarm that should fire almost immediately, spending enough time in the main thread without returning to the event loop that it fires, and then canceling it before returning to the event loop, and then making sure it doesn't fire."
(Assignee)

Updated

3 years ago
Assignee: nobody → bob.silverberg
Status: NEW → ASSIGNED
Iteration: --- → 47.3 - Mar 7
(Assignee)

Updated

3 years ago
Iteration: 47.3 - Mar 7 → 48.1 - Mar 21
(Assignee)

Comment 1

3 years ago
Created attachment 8731263 [details]
MozReview Request: Bug 1252604 - Change logic in alarms observer to return immediately if the alarm has been cancelled, r?kmag

Review commit: https://reviewboard.mozilla.org/r/40469/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/40469/
Attachment #8731263 - Flags: review?(kmaglione+bmo)
Attachment #8731263 - Flags: review?(kmaglione+bmo) → review+
Comment on attachment 8731263 [details]
MozReview Request: Bug 1252604 - Change logic in alarms observer to return immediately if the alarm has been cancelled, r?kmag

https://reviewboard.mozilla.org/r/40469/#review36975
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Comment 4

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/77258bd00fa3
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48

Updated

8 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.