Money watchdog cancels a durable import after restart lease recovery #1170

Open
opened 2026-10-06 01:56:33 +00:00 by kayg · 4 comments
Owner

Blocking finding from #1140 follow-up at head 3ffe13e318.

The real production walkthrough acknowledges a 15 MB ZIP import (8 synthetic transactions), restarts the real server, reopens the wizard and reloads it. The durable queue transfers the job to a second attempt. The browser then shows “The connection stopped while your export was being read. Your file is still selected; retry to continue.” The queue row is cancelled, attempts=2. No completed notification is present. The test stops waiting for review on light/390; the rest of the screenshot matrix does not run.

Source: apps/web/src/lib/money/import-session.svelte.ts #checkStall only exempts the literal Resuming import stage. Once the recovered Worker publishes a parser stage, six seconds without changed counts calls #failStalled, which DELETEs the durable job. This is a functional cancellation, not a SLOW-only test deadline. The current six-second recovery assertion was kept unchanged.

Required follow-up: keep an acknowledged recovered job alive through legitimate parser work, without losing explicit cancellation or bounded upload retry. Add a focused regression that reaches parser work after lease recovery, remains without changed counts beyond six seconds, then completes. Reconcile the existing idle-recovery assertion with the owner rather than changing it silently. Rerun the full width/theme macOS matrix and fresh-browser notification replacement Undo. See #1140 attachments failed-review.png and partial-production-evidence.zip. Do not merge #1140 until this passes.

Blocking finding from #1140 follow-up at head 3ffe13e318b062cadcfc2637e62900807205691f. The real production walkthrough acknowledges a 15 MB ZIP import (8 synthetic transactions), restarts the real server, reopens the wizard and reloads it. The durable queue transfers the job to a second attempt. The browser then shows “The connection stopped while your export was being read. Your file is still selected; retry to continue.” The queue row is cancelled, attempts=2. No completed notification is present. The test stops waiting for review on light/390; the rest of the screenshot matrix does not run. Source: apps/web/src/lib/money/import-session.svelte.ts #checkStall only exempts the literal Resuming import stage. Once the recovered Worker publishes a parser stage, six seconds without changed counts calls #failStalled, which DELETEs the durable job. This is a functional cancellation, not a SLOW-only test deadline. The current six-second recovery assertion was kept unchanged. Required follow-up: keep an acknowledged recovered job alive through legitimate parser work, without losing explicit cancellation or bounded upload retry. Add a focused regression that reaches parser work after lease recovery, remains without changed counts beyond six seconds, then completes. Reconcile the existing idle-recovery assertion with the owner rather than changing it silently. Rerun the full width/theme macOS matrix and fresh-browser notification replacement Undo. See #1140 attachments failed-review.png and partial-production-evidence.zip. Do not merge #1140 until this passes.
Author
Owner

Fixed browser cancellation paths in the watchdog. Unchanged parser counts and missing optional progress now keep polling the same durable job ID. Only an idle Tus upload is paused for Retry; its timeout sends no job DELETE. Explicit Cancel still cancels that same job. Focused tests: Test Files 1 passed (1); Tests 27 passed (27). Regression covers lease handoff, parser counts unchanged for 8.5 seconds, then review. The owner instruction in wizard3-1140 explicitly supersedes the original six-second cancellation expectation. Production restart and all fresh screenshots are next.

Fixed browser cancellation paths in the watchdog. Unchanged parser counts and missing optional progress now keep polling the same durable job ID. Only an idle Tus upload is paused for Retry; its timeout sends no job DELETE. Explicit Cancel still cancels that same job. Focused tests: Test Files 1 passed (1); Tests 27 passed (27). Regression covers lease handoff, parser counts unchanged for 8.5 seconds, then review. The owner instruction in wizard3-1140 explicitly supersedes the original six-second cancellation expectation. Production restart and all fresh screenshots are next.
Author
Owner

The real production phone regression now passes: PASS restarted durable import completes under the same ID and wizard shows review without cancellation. The test uploads the 15 MB fixture, receives durable admission, restarts the real server, closes/reopens and reloads the wizard, then checks ready state, original progress_id and no job DELETE. The focused production walk is continuing through publication and notification Undo. Unit recovery tests and both full web gates passed.

The real production phone regression now passes: PASS restarted durable import completes under the same ID and wizard shows review without cancellation. The test uploads the 15 MB fixture, receives durable admission, restarts the real server, closes/reopens and reloads the wizard, then checks ready state, original progress_id and no job DELETE. The focused production walk is continuing through publication and notification Undo. Unit recovery tests and both full web gates passed.
Author
Owner

Live restart recovery passed twice. Follow-up found a separate explicit-Cancel gap: readPreview clears its in-memory job ID on a failed result, but retains the durable recovery UUID. Cancel previously did not use that retained UUID. It now resolves the saved identity only for explicit User Cancel; a 404 means no job was admitted and the draft can still be discarded. New tests cover failed-result cancellation and unadmitted draft cleanup. All 29 focused tests pass. Rebuilding the web and refreshing the gates before the final matrix.

Live restart recovery passed twice. Follow-up found a separate explicit-Cancel gap: readPreview clears its in-memory job ID on a failed result, but retains the durable recovery UUID. Cancel previously did not use that retained UUID. It now resolves the saved identity only for explicit User Cancel; a 404 means no job was admitted and the draft can still be discarded. New tests cover failed-result cancellation and unadmitted draft cleanup. All 29 focused tests pass. Rebuilding the web and refreshing the gates before the final matrix.
Author
Owner

Fixed #1170 on head 02050bea9c6bc889f5d0c7739a3a242100676049 (job/wizard-1140). The browser keeps the durable UUID and polls its result across outages and unchanged/missing optional progress. The watchdog never cancels server work. Explicit Cancel retains its UUID after failed transport state. A real server restart reaches review under the admitted ID without a browser DELETE. The server Worker also preserves a ready preview through same-process queue replay; a lost plan is rebuilt after restart.

Gate output (verbatim):

perf-lint: PASS; 0 violations; 22177 scoped exceptions
svelte-check found 0 errors and 4 warnings in 3 files
 Test Files  271 passed (271)
      Tests  1878 passed (1878)
test result: ok. 102 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 63.42s
test result: ok. 27 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out; finished in 8.25s

cargo fmt --check and per-crate clippy pass. Current production evidence, all 175 capture times, files, decisions and merge-round commands are in the final report on #1140. Known follow-ups: #1174 (harmless cleanup message), #1176 (unexplained browser target closure in a long optional run; isolated format acceptance passes). No product design decision was added. No push. Build output was cleaned.

Fixed #1170 on head `02050bea9c6bc889f5d0c7739a3a242100676049` (`job/wizard-1140`). The browser keeps the durable UUID and polls its result across outages and unchanged/missing optional progress. The watchdog never cancels server work. Explicit Cancel retains its UUID after failed transport state. A real server restart reaches review under the admitted ID without a browser DELETE. The server Worker also preserves a ready preview through same-process queue replay; a lost plan is rebuilt after restart. Gate output (verbatim): ``` perf-lint: PASS; 0 violations; 22177 scoped exceptions svelte-check found 0 errors and 4 warnings in 3 files Test Files 271 passed (271) Tests 1878 passed (1878) test result: ok. 102 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 63.42s test result: ok. 27 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out; finished in 8.25s ``` `cargo fmt --check` and per-crate clippy pass. Current production evidence, all 175 capture times, files, decisions and merge-round commands are in the final report on [#1140](https://git.kayg.org/kayg/calternal/issues/1140). Known follow-ups: #1174 (harmless cleanup message), #1176 (unexplained browser target closure in a long optional run; isolated format acceptance passes). No product design decision was added. No push. Build output was cleaned.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#1170
No description provided.