Open aliams opened 6 years ago
cc @beverloo
+1 It would be useful to programmatically trigger a refresh also for testing pushsubscriptionchange
. Currently there is no way to test it! Indeed if you block and then allow the notifications you will never get the "refresh" event - the events triggered in this way don't have oldSubscription and newSubscription...
We are interested in shipping this API.
I was wondering if we can consider having an atomic resubscribe method for push? Apparently there are sites that unsubscribe and then try to subscribe again and then they lose their subscription if the browser is closed, for instance. It would be ideal if we were able to subscribe another channel and then if it succeeds, we remove the old channel.
After chatting with @beverloo, it sounded like we should have something like
PushManager.refreshSubscription()
that invokes the refresh algorithm and would return aPromise<void>
that'd be resolved when thepushsubscriptionchange
event has finished executing.