Closed
Bug 969318
Opened 10 years ago
Closed 10 years ago
"A promise chain failed to handle a rejection" from the livemarks service (deprecate passing a callback)
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: mak, Assigned: mak)
References
Details
Attachments
(1 file)
79.91 KB,
patch
|
asaf
:
review+
|
Details | Diff | Splinter Review |
The livemarks service is now accepting both callbacks and returning a promise, the problem is that consumers using the callback are not handling the promise, so when we reject it an error is printed to the error console stating "A promise chain failed to handle a rejection". There are some possibilities here: 1. add at least one internal handler Yoric suggested promise.then(null, () => undefined); // Ensure that there is at least one consumer for this error 2. return the promise only if a callback is not provided 3. split the promise and the callback APIs 4. bug 896186 keep only the promise api and break all consumers
Assignee | ||
Comment 1•10 years ago
|
||
4. could even be done with a mozIAsyncLivemarks compatible shim (that only gets the callback)
Comment 2•10 years ago
|
||
Note that option 1. is actually let promise = ...; promise.then(null, () => undefined); // Ensure that there is at least one consumer for this error return promise; // However, if anybody else does promise.then(), they will get the uncaught error warning
Assignee | ||
Comment 3•10 years ago
|
||
I think the best option for now is 2 (short term) followed by 4 (long term) Mano, what do you think?
Flags: needinfo?(mano)
Assignee | ||
Comment 6•10 years ago
|
||
I'll go for option 2 and ask for review
Assignee: nobody → mak77
Flags: needinfo?(mano)
Assignee | ||
Updated•10 years ago
|
Blocks: fxdesktopbacklog
Summary: "A promise chain failed to handle a rejection" from the livemarks service → "A promise chain failed to handle a rejection" from the livemarks service (deprecate passing a callback)
Updated•10 years ago
|
Whiteboard: [triage]
Assignee | ||
Comment 7•10 years ago
|
||
It's mostly "automatic" refactoring to convert callbacks to .then, and I added the deprecate warnings. From here converting the service to a module should be straight forward, we may then keep the service as a shim wrapping the module, for some releases.
Attachment #8386367 -
Flags: review?(mano)
Updated•10 years ago
|
Comment 8•10 years ago
|
||
Comment on attachment 8386367 [details] [diff] [review] patch v1 Many many thanks for taking care of converting the consumers.
Attachment #8386367 -
Flags: review?(mano) → review+
Assignee | ||
Comment 9•10 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/60c1af78091a
OS: Windows 8.1 → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla30
https://hg.mozilla.org/mozilla-central/rev/60c1af78091a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Whiteboard: [triage]
Updated•10 years ago
|
No longer blocks: fxdesktopbacklog
You need to log in
before you can comment on or make changes to this bug.
Description
•