Bug 1865488 Comment 6 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Daniel Veditz [:dveditz] from comment #5)
> Looking at MDN docs it looks like this is expected: chrome and edge require it, but it's optional in Firefox. Or at least it's optional in `PushManager.subscribe()`;

That sounds wrong, Blink doesn't require it either: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/push_messaging/push_manager.idl;l=14;drc=047c7dc4ee1ce908d7fea38ca063fa2f80f92c77

But per the spec they might reject it during the method call per [step 5](https://w3c.github.io/push-api/#subscribe-method): If the options argument does not include a non-null value for the applicationServerKey member, and the push service requires one to be given, queue a global task on the networking task source using global to reject promise with a "NotSupportedError" DOMException.

> I don't know if using it is supposed to be optional if you -do- supply it as you said you did.

Doesn't seem so [per the spec](https://w3c.github.io/push-api/#dom-pushsubscriptionoptionsinit-applicationserverkey): the push service will reject any push message unless the corresponding private key is used to generate an authentication token.

(In reply to Daniel Veditz [:dveditz] from comment #4)
> Does this happen in a Desktop Firefox as well? 
> * If it's just Android then the bug should be moved to the "Push" component of the "Fenix" product
> * If it's both then the bug should be in the "DOM: Notifications" component of the "Core" product

Good question, the push service module is different between desktop and android so it's possible that only one side is affected. (I've not confirm this anywhere though, will do soon)
(In reply to Daniel Veditz [:dveditz] from comment #5)
> Looking at MDN docs it looks like this is expected: chrome and edge require it, but it's optional in Firefox. Or at least it's optional in `PushManager.subscribe()`;

That sounds wrong, Blink doesn't require it either: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/push_messaging/push_manager.idl;l=14;drc=047c7dc4ee1ce908d7fea38ca063fa2f80f92c77

But per the spec they might reject it during the method call per [step 5](https://w3c.github.io/push-api/#subscribe-method): If the options argument does not include a non-null value for the applicationServerKey member, and the push service requires one to be given, queue a global task on the networking task source using global to reject promise with a "NotSupportedError" DOMException.

> I don't know if using it is supposed to be optional if you -do- supply it as you said you did.

Doesn't seem so [per the spec](https://w3c.github.io/push-api/#dom-pushsubscriptionoptionsinit-applicationserverkey): the push service will reject any push message unless the corresponding private key is used to generate an authentication token.

(In reply to Daniel Veditz [:dveditz] from comment #4)
> Does this happen in a Desktop Firefox as well? 
> * If it's just Android then the bug should be moved to the "Push" component of the "Fenix" product
> * If it's both then the bug should be in the "DOM: Notifications" component of the "Core" product

Good question, the push service module is different between desktop and android so it's possible that only one side is affected. (I've not confirmed this anywhere though, will do soon)

Back to Bug 1865488 Comment 6