Problem/Motivation

We installed updates for our Open Social instance and Social PWA upgraded from alpha7 to alpha10. Since this update users no longer can enable push notifications on their settings page. The toggle button can be clicked but this doesn't trigger any response from the system. We confirmed that this isn't caused by the browser not allowing push notifications.

Existing push notification subscriptions do still work. However the user cannot see that they have this enabled on their settings page as the toggle for push notifications visually displays as off.

Downgrading to alpha7 does cause the system to respond again, but with the following two issues:

  1. Downgrading can cause the entire system to go down. There's some sort of sequence/library dependency that can break Open Social if not correctly done during the downgrade.
  2. If you get a working platform after the downgrade the permission dialogue is triggered but not displayed (you can only see the modal background). The issue is caused by the code having a hardcoded path to /sw.js that it tries to load via JavaScript. But this receives a redirect due to the language path to /nl/sw.js which then triggers browser security and prevents load. Directly accessing /nl/sw.js does return the js file successfully
CommentFileSizeAuthor
#3 social_pwa-3200316-3.patch28.82 KBkingdutch

Comments

collinm created an issue. See original summary.

kingdutch’s picture

Title: Enabling push notifications doesn't work » The ID attribute for the push subscription management script does not match the generated ID of the toggle element
Related issues: +#3083976: Push notifications provider

This seems to have been caused by the change in #3083976: Push notifications provider which changed the creation of the forms. As a result the ID of the toggle element has changed but the main.js wasn't updated.

kingdutch’s picture

Version: 8.x-1.0-alpha10 » 8.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new28.82 KB

The attached patch does a bit more than is strictly required. Most importantly it pulls apart the logic for installing the service worker and prompting users to enable push notifications from the logic that handles the form on the settings page. This should improve maintainability.

Most importantly for this issue it fixes the selector of the form.

  • Kingdutch committed d0b7040 on 8.x-1.x
    Issue #3200316 by Kingdutch, collinm: The ID attribute for the push...
kingdutch’s picture

Status: Needs review » Fixed
kingdutch’s picture

Status: Fixed » Closed (fixed)

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