GoogleChromeLabs / web-push-codelab

Other
557 stars 293 forks source link

Unsubscribe Event does not remove subscription from browser settings #100

Open florianPopulaer opened 3 years ago

florianPopulaer commented 3 years ago

`const unsubscribe = async () => { let serviceWorker = await navigator.serviceWorker.ready;

serviceWorker.pushManager.getSubscription()
    .then( (subscription) => {
        console.log(subscription);
        subscription.unsubscribe()
    })
    .then( (success) => {
        console.log(`unsubscribed successfully: ${success}`);
    })
    .catch( (error) => {
        console.log(`error unsubscribing: ${error}`);
    });

}`

The function is hooked to an unsubscribe button. According to the console, the unsubscription worked fine. I can see the subscription object (to be deleted) and the success message "unsubscribed successfully". However, when I check in the Browser settings, the subscription ist still there and enabled. Is that expected behaviour? Or am I missing something?