notifications.create should return Promise.reject (if notifications.create failed)



a year ago
5 months ago


(Reporter: kernp25, Unassigned)


Firefox Tracking Flags

(Not tracked)




a year ago
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20170628030206

Steps to reproduce:

It says [1], notifications.create can fail on some systems, so i think it should return a Promise.reject here (or something else) instead of just returning 'Promise.resolve(notificationId);' [2].


Because, otherwise how can we detect if notifications.create succeed or not?

If notifications.create failed for some reason we then can create our own notification and display it to the user.

Because my addon relies on the notification.
Comment hidden (me-too)
This seems like a valid suggestion. Kris, what do you think?
Flags: needinfo?(kmaglione+bmo)
I suppose one problem with doing this would be if Chrome does not do this, in which case we might break some extensions by throwing errors when they are not expected. Redirecting my needinfo to zombie for his ideas.
Flags: needinfo?(kmaglione+bmo) → needinfo?(tomica)
I don't think this is actually a real issue, that comment probably refers to non-supported platforms like Thunderbird or something.

I guess rejecting in that case wouldn't hurt, but probably P5.
Flags: needinfo?(tomica)
Priority: -- → P5


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