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

Push notification type checkboxes incorrect for GotoSocial, possibly others #1032

Open
VyrCossont opened this issue Jan 22, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@VyrCossont
Copy link

VyrCossont commented Jan 22, 2025

Site

phanpy.social

Version

No response

Instance

princess.industries

Browser

Safari 18.2 on macOS Sequoia 15.2

Bug description

Push subscription checkboxes show all notification types as enabled, when some of them are not enabled.

To reproduce

  • Install GotoSocial from the push notification support PR: [feature] Push notifications superseriousbusiness/gotosocial#3587
  • Log into GtS from Phanpy
  • Subscribe to push notifications
  • Uncheck some notification type checkboxes
  • Close the settings page
  • Return to the settings page
  • All notification types are checked regardless of the actual subscription API response

Expected behavior

Phanpy seems to decode Mastodon's WebPushSubscription incorrectly. It should not show notification types as enabled when they are present as key-value pairs in the alerts object where the value is false. I think what it's actually doing is just looking at the keys and ignoring the values, so this should be pretty easy to fix.

This works with current versions of Mastodon because they don't send key-value pairs in alerts for disabled notification types. However, as shown in the Mastodon docs, Mastodon may send them, and Phanpy should not treat disabled types as enabled.

GotoSocial always sends all supported notification types in alerts whether they're enabled or disabled.

Other Mastodon API implementations may also do that, so this bug isn't necessarily limited to GtS. I haven't checked with Akkoma, but that's the only other one I know of with Web Push support.

Other

This could well be related to #317.

@VyrCossont VyrCossont added the bug Something isn't working label Jan 22, 2025
@VyrCossont VyrCossont changed the title Push notification settings decoded improperly Push notification type checkboxes incorrect for GotoSocial, possibly others Jan 22, 2025
@VyrCossont
Copy link
Author

I think this is the problem spot: https://github.com/cheeaun/phanpy/blob/acb7084/src/pages/settings.jsx#L986-L992

cheeaun added a commit that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant