If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

mozAlarms and simplepush should report errors when registering with bad application setup

NEW
Unassigned

Status

()

Core
DOM: Device Interfaces
3 years ago
2 years ago

People

(Reporter: rik, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
To receive alarms or simple push messages, a lot of conditions have to be met:

- You need to ask for the permissions in the manifest
- You need to declare where to send messages in the manifest
- You need to set an alarm or register an endpoint at the same URL that will receive the message (this is especially tricky)

If you fail to do all those 3 things, you will not receive the system message and you have no idea why. I got bitten by this twice and the first time I was lucky to sit next to people who implemented it.

I think navigator.push.register() and navigator.mozAlarms.add() should fail if those 3 conditions are not met. This will make app developers' lives much simpler.
I just hit similar issues with navigator.sync, so I would have appreciated this sort of requirements check.

I missed setting a "messages" entry in the manifest, so did not get mozSetMessageHandler('request-sync'...) calls. That API is further complicated by the navigator.sync taking a wakeUpPage URL that would be the entry point for the wakeup, so could be unclear the "messages" entry point was needed.
You need to log in before you can comment on or make changes to this bug.