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

RESOLVED FIXED in Firefox 48

Status

()

Toolkit
WebExtensions: Untriaged
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: bsilverberg, Assigned: bsilverberg)

Tracking

unspecified
mozilla48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

2 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

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

Updated

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

Comment 1

2 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

2 years ago
Keywords: checkin-needed

Comment 3

2 years ago
https://hg.mozilla.org/integration/fx-team/rev/77258bd00fa3
Keywords: checkin-needed

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/77258bd00fa3
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.