w3c / geofencing-api

13 stars 9 forks source link

GeofenceManager: Use of DOMException in rejecting promise for add() (from Josh Soref) #18

Closed gmandyam closed 8 years ago

gmandyam commented 9 years ago

Section 6.2:

If not granted, reject promise with a DOMException whose name is "PermissionDeniedError" and terminate these substeps.

Didn't Geolocation get forced to have an infinite timeout instead of a permission denied specifically because this design is sufficiently annoying that it shouldn't be used?

mkruisselbrink commented 8 years ago

I'm beginning to think that maybe it might make sense to separate registration of geofences and triggering of events more. Registration would pretty much always succeed, but events wouldn't be triggered unless permission was granted, hardware is available and turned on, etc.

I'm not entirely sure how to best expose whether an app should be expecting events: The permissions API gives all that is needed for an app to be able to check/request/monitor the availability of some kind of geofencing permission, but separately from that something might be needed to check/monitor availability of geofencing/geolocation services. That's also somewhat related to actually better speccing what error events are/mean.

mkruisselbrink commented 8 years ago

This is partly addressed in 38f11ce20ea8ffe06f5ff9044e0c577652b01caa, which changes the API to not reject adding a new geofence is permission is denied. The actual interaction with the permissions API still needs to be specified though.

mkruisselbrink commented 8 years ago

Filed #26 for the permissions API part of this, so closing this issues since I think the rest is addressed.