You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
VyrCossont
changed the title
Push notification settings decoded improperly
Push notification type checkboxes incorrect for GotoSocial, possibly others
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
subscription
API responseExpected 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 thealerts
object where the value isfalse
. 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.
The text was updated successfully, but these errors were encountered: