Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict of PWA and OneSignal (caused by Service Workers) #2104

Open
adekbadek opened this issue Nov 3, 2022 · 2 comments
Open

Conflict of PWA and OneSignal (caused by Service Workers) #2104

adekbadek opened this issue Nov 3, 2022 · 2 comments

Comments

@adekbadek
Copy link
Member

Describe the bug

Both PWA and OneSignal plugins register their Service Workers, which are in conflict.

This is a known issue (link, link), which is not caused by Newspack. But it can perhaps be solved by this plugin.

To Reproduce

  1. Install PWA and OneSignal plugins on a new WP site
  2. Configure OneSignal
  3. In a new (non-incognito!) session, load the site and subscribe to notifications by clicking the bell icon in the bottom right corner
  4. Send a new notification from the OneSignal dashboard
  5. Observe a notification with "This site has been updated in the background" payload instead of the intended message

Next steps

Delaying the OneSignal initialization, as described here, has worked – but only if OneSignal was initialized well after the PWA Service Worker has been installed & activated. In my testing, a delay of 10s worked, but in production this should be solved by waiting for the SW activation event.

@yogeshbeniwal
Copy link
Contributor

Service Workers for OneSignal was moved to new scope: /push/onesignal/ already to take care of conflict with PWA OneSignal/OneSignal-WordPress-Plugin#268

@adekbadek
Copy link
Member Author

Thanks! Still, the issue is reproducible and it relates to SWs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants