-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
[feature] Push notifications #3587
base: main
Are you sure you want to change the base?
Conversation
8da67c7
to
f663f56
Compare
In process of testing with Phanpy (using Safari with Apple's Web Push server):
and Feditext:
|
Handling errors from Safari's Web Push server: https://developer.apple.com/documentation/usernotifications/sending-web-push-notifications-in-web-apps-and-browsers#Review-responses-for-push-notification-errors |
Looking great so far, very exciting :) |
So here's a fun thing I just learned:
|
Horrible thought: we could have both standards-compliant Web Push encryption and Mastodon Clown Car Web Push encryption implementations and send both for every Web Push notification, or at least until we get an error back from the Web Push server that implies we should use one or the other |
This is not a Mastodon specific issue. The web-push JS library which is cited by both Mozilla and Google and is seemingly some sort of reference implementation still |
Sounds like I need to check whether Mozilla and Google Web Push servers can take |
|
Let me know if you need any help with this / want an NTFY set up on superseriousbusiness.org or anything like that :) You seem to be pushing through it fine but I'm happy to help if I can! |
So we apparently don't need to worry about Chrome or Firefox (at least the name-brand versions), as their push servers handle Safari is reporting problems with the (VAPID) JWT, and it looks like |
Yep, that worked, we're good on Safari now. |
81993c6
to
66632bf
Compare
Mastodon just added support for modern Web Push (what I'm implementing here) with mastodon/mastodon#33528 which should improve the state of the ecosystem a bit. It looks like this is opt-in and there's a new |
We really should be doing some kind of Unicode bidirectional text isolation when building notification titles from display names, and indeed anywhere that we build a string from partially attacker-controlled text, but we should probably try to solve that for all of GtS and add it to this later. It's a huge pain in the ass, and there are bugs in the nascent Go library for dealing with bidi text: |
OK, this is ready for review. I'll handle the policy, admin report, use of |
internal/db/bundb/migrations/20241124012636_add_web_push_subscriptions.go
Outdated
Show resolved
Hide resolved
This is looking great! I have a few comments but nothing major, almost ready to squerge imo :) Great work @VyrCossont ! |
Not used yet
and remove PutVAPIDKeyPair
Most client errors should remove the subscription.
Also removes redundant unique and notnull tags on ID column since these are implied by pk
e83dff1
to
b982944
Compare
Description
This pull request implements Web Push notifications.
Closes #1350
Checklist
go fmt ./...
andgolangci-lint run
.TODO
Topic
header for multiple updates to the same status (probably pointless until edits are implemented)