refactor(autosave): rename flushViaBeacon → flushOnUnload; add void to fire-and-forget fetch
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m27s
CI / OCR Service Tests (push) Successful in 31s
CI / Backend Unit Tests (push) Failing after 2m48s
CI / Unit & Component Tests (pull_request) Failing after 2m44s
CI / OCR Service Tests (pull_request) Successful in 29s
CI / Backend Unit Tests (pull_request) Failing after 2m46s

The sendBeacon name was misleading after switching to keepalive fetch.
Also adds a test to confirm flush is a no-op when pendingTexts is empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-22 16:46:58 +02:00
parent e5a2a89582
commit 61b89ac9e4
3 changed files with 21 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ $effect(() => {
$effect(() => {
function onBeforeUnload() {
autoSave.flushViaBeacon();
autoSave.flushOnUnload();
}
window.addEventListener('beforeunload', onBeforeUnload);
return () => {