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

Command icon 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

robertragas created an issue. See original summary.

robertragas’s picture

Status: Active » Needs review
kingdutch’s picture

Status: Needs review » Reviewed & tested by the community

  • robertragas committed 06145c8b on 2.0.x
    Issue #3447595 : When the user has seen the pop-up and the prompt has...
kingdutch’s picture

This 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 in social_pwa.module would 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 of setTimeout this 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.

  • robertragas committed e9e74f71 on 2.1.x
    Issue #3447595 : When the user has seen the pop-up and the prompt has...
robertragas’s picture

Status: Reviewed & tested by the community » Fixed

Landing in 2.1.8 and 2.0.10

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.