Can't keep desktop push notifications enabled - dup

This is a duplicate of this

Could not comment there as it was closed

This is still happening to me

discourse-push-notifications v0.3.0
discourse v2.5.0.beta2

Which browser? What browser version number? Did you try in a different web browser? Did you try with all your browser plugins disabled, with a clean vanilla unmodified install of the browser?

2 Likes

Reproduced both in Chrome and Firefox.

Chrome Version 80.0.3987.149 (Official Build) (64-bit)

Firefox 74.0 (64-bit)

OS:

Ubuntu 19.10

Tried in incognito mode as well, without any extensions and same outcome.

Adding a short video to demonstrate:

I found this post later: Discourse Push Notifications for Desktop that describes a similar issue

1 Like

I can confirm this is happening in Chrome on Windows and on Android as well

I took a look at the network call when changing the toggle on/off and saving

When hitting the save button there’s a network call to

PUT https://discourse.example.com/u/{user-id}.json

When saving with the toggle ON - this is what sent in form data:

new_topic_duration_minutes: 2880
auto_track_topics_after_msecs: 240000
notification_level_when_replying: 2
like_notification_frequency: 1
allow_private_messages: true

When saving the page with toggle OFF - this is what sent in form data

new_topic_duration_minutes: 2880
auto_track_topics_after_msecs: 240000
notification_level_when_replying: 2
like_notification_frequency: 1
allow_private_messages: true

As you can see they are identical and it doesn’t seem like the prefer push option is there.

In addition, looking at localstorage, I see a property called discourse_push_notifications_prefer_push which alternate between empty and true when toggling the prefer push option on/off but that doesn’t seem to be added to the network call

Also, I manually ran the evaluation of isPushNotificationsSupported in my Discourse browser console, and it evaluated to true, meaning, I guess, that push is supported…

I would also add that the enable notification button is working fine:
image
And I do see the test notification when enabled

1 Like

Is this a bug @falco?

2 Likes

Looks like it is. Considering this isn’t the most used feature, push is common on mobile and desktop notifications are the most common on the desktop, and I don’t think anyone on the team or in our hosting uses this, I’m not surprised.

I’ll try to fix it this week.

2 Likes

Okay, so now you got me confused

By “desktop notifications” do you mean this setting ?
image

I had these enabled since day 1, and never got any browser notification

  1. When I first signed in to Discourse, I saw a message at the top asking me if I wanted to enable notifications
  2. I opted in, a native Chrome dialog appeared and I approved, I also got a message in Ubuntu notifications area
  3. However, I am not getting any notification about any activity ever. When I switch to Discourse tab, I see the “1” icon in my profile icon at the top right, but I have to actively switch to the tab to know about it. Is this the expected behavior ?
  4. Therefor, I assumed this plugin was the thing that made it possible to see activity if you’re not on Discourse tab currently.

So I was wrong ? What am I missing ?
Confused :confused:

This is working now, and should keep working during key migrations with Automatically renew the push notifications subscription

2 Likes