Watching First Post does not send push notifications


(Angus McLeod) #1

Steps to reproduce

  1. Enable browser push notifications for User A.
  2. Set User A’s notification level for Category A to “Watching First Post”.
  3. Log in as User B (in incognito) and post in Category A (Post A)

Expected: User A would receive a browser push notification for Post A.
Actual: User A receives no browser push notification. Notifications (i.e. in the user menu) and email alerts work as expected.

Likely Cause

In the PostAlerter notify_first_post_watchers passes Notification.types[:watching_first_post] as the type to create_notification: discourse/post_alerter.rb at master · discourse/discourse · GitHub

create_notification restricts the creation of notification alerts to NOTIFIABLE_TYPES which does not include :watching_first_post: discourse/post_alerter.rb at master · discourse/discourse · GitHub

This may be intentional, however reading through this discussion, I suspect not?


(Angus McLeod) #2

Any update on this one? I’d be happy to make a PR that adds watching_first_post to NOTIFIABLE_TYPES.


(David Taylor) #3

This sounds like an oversight to me - watching first post should be exactly like watching… except only for the first post :wink: .

I think we can take the likes from Jeff and Sam to mean this is definitely #pr-welcome


(Angus McLeod) #4

Made a PR for this: add watching_first_post to NOTIFIABLE_TYPES by angusmcleod · Pull Request #6887 · discourse/discourse · GitHub


(Jeff Atwood) #5

Sure @david can you review?


(David Taylor) #7

Merged, thanks @angus


(David Taylor) #10

This topic was automatically closed after 3 days. New replies are no longer allowed.