feat(push): encrypted push notifications via event_id_only and decryption relay#295
Merged
Just-Insane merged 6 commits intodevfrom Mar 16, 2026
Merged
feat(push): encrypted push notifications via event_id_only and decryption relay#295Just-Insane merged 6 commits intodevfrom
Just-Insane merged 6 commits intodevfrom
Conversation
Contributor
Deploying with
|
| Status | Preview URL | Commit | Alias | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! | https://pr-295-sable.raspy-dream-bb1d.workers.dev | 05e1d81 | pr-295 |
Mon, 16 Mar 2026 14:17:54 GMT |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Implements privacy-first push notifications using the Matrix
event_id_onlypusher format, with client-side decryption relay for E2EE rooms.Why
Currently, even with "show encrypted message content" disabled, the homeserver sends the full encrypted event blob + sender display name + room name to Sygnal. With
event_id_only, Sygnal sees nothing about message content, sender, or room — it only forwards{ room_id, event_id }.How it works
format: 'event_id_only'— the homeserver strips all content before forwarding to Sygnal.room_id+event_id, notype) and fetches the raw event from the homeserver using the stored bearer token. Room name and sender display name are also resolved via homeserver state APIs.m.room.encrypted): SW postsdecryptPushEventto an open app tab and waits up to 5s for apushDecryptResultreply. The reply includesdocument.visibilityStateso the SW can suppress the OS notification entirely if the app is currently visible (avoiding a double-alert).HandleDecryptPushEvent): callsmx.decryptEventIfNeeded()with the raw event, resolves the sender display name and room name via the SDK, and replies with the decrypted content.Fallback matrix
iOS encrypted message limitation
On iOS, the system kills and restarts the service worker for every push, and any backgrounded app tabs are frozen (JS suspended). The decryption relay (SW → app tab → SW) requires a live JS context to call
decryptEventIfNeeded(), which iOS does not provide. As a result, encrypted message content is not shown on iOS — the notification correctly displays sender name and room name, but the body falls back to "Encrypted message".This is a platform limitation of iOS PWAs. A future native app (e.g. via Tauri v2 +
tauri-plugin-push-notifications) could address this using an APNS Notification Service Extension to decrypt in a sandboxed Rust process before the notification is displayed.Testing
After deploying, re-enable push notifications in Settings to re-register the pusher with the new
formatfield. Then send messages from another client while Sable is backgrounded.