w3c / push-api

Push API
https://w3c.github.io/push-api/
Other
144 stars 40 forks source link

unsubscribe() method interaction with event loop #378

Open annevk opened 1 week ago

annevk commented 1 week ago

Reading https://w3c.github.io/push-api/#dom-pushsubscription-unsubscribe it's rather unclear to me what is supposed to happen on the main thread and what happens in parallel. In fact, it almost seems like this could have been a synchronous method from the perspective of the caller?

saschanaz commented 1 week ago

I think it's reasonable to make it async to make sure the unsubscribe request is passed to the backend server. But then it doesn't say anything about the failure case, e.g. throw error or return false?