alarms.create is not declared as an async function
Categories
(WebExtensions :: General, defect, P3)
Tracking
(firefox138 fixed)
Tracking | Status | |
---|---|---|
firefox138 | --- | fixed |
People
(Reporter: robwu, Assigned: erosman, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, good-first-bug)
Attachments
(1 file, 1 obsolete file)
The alarms.create
method is not declared as an async
function. Consequently, it is not possible for extension callers to await the registration of an alarm.
Moreover, it is not possible to raise async errors. The current implementation doesn't raise such errors, but there is precedent in other browsers to do so, e.g. in Chrome creating 500+ timers results in an error (e.g. seen at https://github.com/w3c/webextensions/issues/422 and tracked at bug 1844605).
This mistake was likely inherit from when the alarms API definition was imported from Chromium. This issue (lack of async callback) was fixed in Chrome 111 by https://chromium.googlesource.com/chromium/src/+/cf0de9610438fb89556cc6a4f9405bfb20cc42ee
Reporter | ||
Comment 1•2 years ago
|
||
The fix would be simple: add "async": "callback"
+ append an optional function parameter, to https://searchfox.org/mozilla-central/rev/cb8fc16f6b1455d1237853dbad21c62870eaaba9/toolkit/components/extensions/schemas/alarms.json#32-35,64
Reporter | ||
Updated•2 years ago
|
Comment 2•1 year ago
|
||
Hey, I would lke to work on this issue and solve it. Kindly can i be assigned for this work as this will be my first PR
Reporter | ||
Comment 3•1 year ago
|
||
(In reply to arunavdutta27 from comment #2)
Hey, I would lke to work on this issue and solve it. Kindly can i be assigned for this work as this will be my first PR
The bug will automatically assigned when a patch is submitted to Phabricator. Since this is your first contribution, check out the tutorial at https://wiki.mozilla.org/WebExtensions/Contribution_Onramp
Assignee | ||
Comment 4•3 months ago
|
||
Updated•3 months ago
|
Assignee | ||
Comment 5•3 months ago
|
||
Updated•3 months ago
|
Comment 7•3 months ago
|
||
bugherder |
Documentation updates in Bug-1869171 alarms.create now async function #38834
Description
•