push: keep the token only while subscribed; toggle reads the account's pusher; replace a stale VAPID subscription
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m14s

Soul pass findings on the stage 0-1 branch: the worker stored the token on every deployment, push configured or not
(now only while the browser holds a push subscription; the page re-sends its session after the toggle changes it);
the toggle read the browser's subscription, not the account's pusher (now both); a subscription under an old VAPID
key was reused (now replaced); a failing client list now still shows the notification.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Void 2026-11-12 20:05:10 +00:00
commit 695a016d4f
8 changed files with 129 additions and 19 deletions

View file

@ -59,6 +59,11 @@ describe('push against a mock gateway and homeserver', () => {
expect(shown[0].options.tag).toBeUndefined();
expect(shown[0].options.data).toBeUndefined();
});
it('shows even when the window list cannot be read', async () => {
const { w, shown } = port({ windows: () => Promise.reject(new Error('no clients')) });
await handlePush(matrixNotify('!r:x', '$e'), w);
expect(shown).toHaveLength(1);
});
it('shows nothing while a window is visible and focused, and shows when the window is hidden', async () => {
const win = (visibilityState: string, focused: boolean) => ({
visibilityState,