ampproject / ampproject/amphtml

<amp-web-push> issue going from "Block" to "Allow" push permission

Open
#28,717 14 comments 6 reactions 1 assignee Claimed by @kristoferbaxter View on GitHub
Component: amp-user-notification Type: Bug WG: performance
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## What's the issue?
There is currently a bug (perhaps a limitation) where manually going from "Block" to "Allow" will not correctly reflect the updated push permission on the main page. This leads to issues such as custom prompting widgets not dismissing or simply continuing to appear altogether despite the permission already set to "Allow"

## How do we reproduce the issue?

[Demo Site](https://amp.dev/documentation/examples/components/amp-web-push/preview/?format=websites)

1. Get prompted for push and accept inside the pop up window
2. Manually change the permission in the browser to "Block"
3. Reload the page
4. Manually change the permission in the browser to "Allow"
5. Reload the page
6. See that the main site still thinks notifications are blocked

To fix it in its current state:

7. Visit [amp-web-push-permission-dialog.html](https://amp.dev/documentation/examples/components/amp-web-push/amp-web-push-permission-dialog.html)
8. Refresh the demo page
9. See that it no longer thinks its blocked
10. You still have to re-subscribe by clicking the button

## What browsers are affected?

Chrome.

Firefox doesn't work at all do to the new user-gesture requirement causing the programmatic native permission request from failing and flickering the popup before it gets dismissed. (This is another issue altogether)

## Which AMP version is affected?

I suspect this has always been broken.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.