Public: anyone can read this; the crew can change it.

A restore drill that runs out of time says which phase it hung in and how far it got #2621

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A restore drill that times out now says which phase it hung in and how far it got. `bun x tsc --noEmit`, `test/snapshot-drill.test.ts` and `test/snapshot-drill-page.test.ts` pass (27 tests). I did not run the rest of the suite.

shipped production is serving it deploy 740aa94

opened this

A restore drill that times out now says which phase it hung in and how far it got. bun x tsc --noEmit, test/snapshot-drill.test.ts and test/snapshot-drill-page.test.ts pass (27 tests). I did not run the rest of the suite.

  • Reason text: runDrill (src/snapshot/drill.ts) now passes onProgress to the restore and keeps the last report it gets. If the restore step times out, the reason reads like restore timed out in bundles (37 of 212 cloned, 1.8 GiB fetched) after its 14 min budget.
  • Other phases: these read N of M done, X so far, for example files (3 of 3 done, 100 B so far).
  • No progress seen, or another step times out: the old wording stays, <step> timed out: no answer within its … budget, so existing tests and rows keep their meaning.
  • Page and sentinel: I changed nothing in src/web/pages/backups.ts or src/snapshot/verdict.ts. /settings/backups already prints d.reason through the escaping html tag, and the sentinel's drill cause already includes r.reason unchanged.
  • Tests:

- A stubbed restore that reports files and then bundles progress and hangs; the test asserts the exact reason string. - A page test that a reason containing <b> appears verbatim but escaped. - The existing "names the failing step" test now expects three drill rows instead of two, because the new test adds one.

I did not add a test that the sentinel's drill cause carries the new reason. That path is the existing verdict.ts formatting, which this change does not touch.

Closes #2618

commented

A restore drill that times out now says which phase it hung in and how far it got. bun x tsc --noEmit, test/snapshot-drill.test.ts and test/snapshot-drill-page.test.ts pass (27 tests). I did not run the rest of the suite.

  • Reason text: runDrill (src/snapshot/drill.ts) now passes onProgress to the restore and keeps the last report it gets. If the restore step times out, the reason reads like restore timed out in bundles (37 of 212 cloned, 1.8 GiB fetched) after its 14 min budget.
  • Other phases: these read N of M done, X so far, for example files (3 of 3 done, 100 B so far).
  • No progress seen, or another step times out: the old wording stays, <step> timed out: no answer within its … budget, so existing tests and rows keep their meaning.
  • Page and sentinel: I changed nothing in src/web/pages/backups.ts or src/snapshot/verdict.ts. /settings/backups already prints d.reason through the escaping html tag, and the sentinel's drill cause already includes r.reason unchanged.
  • Tests:

- A stubbed restore that reports files and then bundles progress and hangs; the test asserts the exact reason string. - A page test that a reason containing <b> appears verbatim but escaped. - The existing "names the failing step" test now expects three drill rows instead of two, because the new test adds one.

I did not add a test that the sentinel's drill cause carries the new reason. That path is the existing verdict.ts formatting, which this change does not touch.

Approved

Does what the issue asks: a restore that times out after reporting progress now says the phase and counts, and the old wording stays for other steps and for a restore that never reported. The reason goes through the existing escaped page and sentinel path, and a test covers the escaping. No new input, write path or dependency, so the terminal and page read the same field. Two things I would do next: (1) keep the snapshot size in the new reason, since the old timeout text had it and the new one drops it; (2) un-export describeProgress unless something else will use it, and give it a direct test per phase, because only the bundles wording is asserted.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs