Problem/Motivation
When using the PWA the pop-up shows asking to enable or not. When pressing "not now" it will pop-up again after a refresh.
The issue lies in the timestamp 'prompt' thats get send for the pop-up. When this is bigger than 29 days it will be ignored and acted on as immediate.
See
https://stackoverflow.com/questions/12168708/is-there-any-limit-to-setti...
Steps to reproduce
- Enable and configure social_pwa
- Open the site in the browser and login
- Notice the pop-up and choose "not now"
- Refresh and see the pop-up shows again.
Proposed resolution
When there is a prompt set, just return without even going into the pop-up part.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork social_pwa-3447595
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
robertragas commentedComment #4
kingdutchComment #6
kingdutchThis was caused by changes made in #3445463: Re-installing the app invalidates the subscription but not the pop-up which incorrectly interpreted the purpose of
pushNotificationPromptTime. Before that issue the code insocial_pwa.modulewould not attach the JavaScript if a prompt result was stored server side for the user. However, this caused the prompt to be shown only on a single device at a time. After the change the JavaScript was always attached. The new logic would only re-show a prompt after [time-since-unix-epoch] which would be very long. However, due to a limitation ofsetTimeoutthis wrapped around to 0 which caused the prompt to be shown again immediately.A caveat to the implementation in #3445463: Re-installing the app invalidates the subscription but not the pop-up is that platforms require support for localStorage now to be able to support push notifications. With the information we currently have, all push notification enabled platforms also support localStorage.
Comment #8
robertragas commentedLanding in 2.1.8 and 2.0.10