Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate(ish) push notifications for subscribed user and territory #1819

Open
1 task done
SatsAllDay opened this issue Jan 17, 2025 · 2 comments · May be fixed by #1820
Open
1 task done

Duplicate(ish) push notifications for subscribed user and territory #1819

SatsAllDay opened this issue Jan 17, 2025 · 2 comments · May be fixed by #1820
Assignees
Labels

Comments

@SatsAllDay
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When stacker to whom you are subscribed posts in a territory to which you’re subscribed, you receive a push notification for each, e.g.:

  1. User posted foo
  2. user posted foo in bar territory

These are deduped in the notifications page. They should also be deduped in push notifications.

Screenshots

I forgot to take one before clearing the notifications.

Steps To Reproduce

  1. Enable push notifications
  2. Subscribe to a user
  3. subscribe to a territory
  4. wait for the user to post in the territory
  5. see 2 notifications

Expected behavior

Only 1 push notification should come through

Logs

No response

Device information

iOS PWA

Additional context

No response

@SatsAllDay SatsAllDay added the bug label Jan 17, 2025
@Soxasora Soxasora self-assigned this Jan 17, 2025
@Soxasora
Copy link
Member

Soxasora commented Jan 17, 2025

Relieved that push notifs works to the point it shows two types of notifications! /kidding

I also think that these types of notifications should be deduped following the same /notifications behavior, I think it would mean using getNotifications without tag filtering first to see if FOLLOW/TERRITORY is there and discard the notification.

edit: Hmm, this could still mess with Apple's rules about onPush events (onPush, if called, must return a notification and must follow a timing that we can't know)

edit2: well we could also check if the user you're subscribed to has posted in a territory you're subscribed to and avoid onPush management altogether

edit3: posted in PR

@SatsAllDay
Copy link
Contributor Author

edit2: well we could also check if the user you're subscribed to has posted in a territory you're subscribed to and avoid onPush management altogether

This is the fix I envisioned. Not de-duping on the client but rather skipping the push altogether. I think it makes sense to send the “user posted in territory” push if both are applicable. It’s more specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants