R9 Web Push in decePub: one subscription per persona, each with its own token and registration
Build / Build (push) Successful in 56s

Settings gets "Notifications on this device" (PushEditor): personas, alerts in four groups, policy, a test
notification, after a one-time notice of what the push service learns. Each persona ticked gets its own service
worker registration (push-worker.js at push/{slot}/), so its own endpoint and keys, subscribed with its own token
(IHttpService's *As); nothing PrivaPub stores ties two personas together and the worker never reads the payload's
token. PushService follows the tokens (re-subscribing after a renewal), reconciles at every session start, turns
off before sign-out and drops deleted or suspended personas. A click opens that persona's notifications; the app
badge counts the unread ones. Exchanges now ask for the push scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-18 09:50:46 +02:00
1 parent d33697e3fc
commit ab17959ed4
29 files changed
+2047 -67

No files matched your search

+9 -1
View File
@@ -1,7 +1,7 @@
namespace decePubClient.Models.Mastodon;
/// <summary>/api/v2/instance, the part the client reads: what the server calls itself and says of itself, its contact,
/// its rules, and what an upload may be.</summary>
/// its rules, what an upload may be, and its Web Push key.</summary>
public class InstanceV2
{
public string Domain { get; set; }
@@ -38,6 +38,14 @@ public class InstanceConfiguration
{
public MediaConfiguration MediaAttachments { get; set; } = new();
public AccountsConfiguration Accounts { get; set; } = new();
public VapidConfiguration Vapid { get; set; } = new();
}
/// <summary>The server's VAPID public key (RFC 8292), the applicationServerKey a browser subscribes to Web Push with: the
/// uncompressed P-256 point, URL-safe base64. Null on a server that pushes nothing.</summary>
public class VapidConfiguration
{
public string PublicKey { get; set; }
}
/// <summary>What an account may hold: how many hashtags it features on its profile (PrivaPub's 10).</summary>