CI / Build & Quality Checks (pull_request) Successful in 2m43s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 12s
CI / Playwright smoke (e2e) (pull_request) Successful in 16m49s
The service worker posts inline notification replies in the clear (it cannot encrypt). The Reply action was only withheld for rooms that were encrypted when the notification was shown, so a reply typed hours later into a room that has since turned on encryption went out unencrypted. It also posted with the newest session the worker knew, not the notification's account. The worker now GETs the room's m.room.encryption state first and only sends on a definite 404; notifications carry the user id and the worker uses that account's session (or refuses). "Reply not sent" says why. Fixes #299 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
12 lines
315 B
TypeScript
12 lines
315 B
TypeScript
export function pushSessionToSW(baseUrl?: string, accessToken?: string, userId?: string) {
|
|
if (!('serviceWorker' in navigator)) return;
|
|
if (!navigator.serviceWorker.controller) return;
|
|
|
|
navigator.serviceWorker.controller.postMessage({
|
|
type: 'setSession',
|
|
accessToken,
|
|
baseUrl,
|
|
userId,
|
|
});
|
|
}
|