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

A migration's progress page follows its stages over the stream, with no meta refresh #3176

Parked opened this
Closed without merging

A migration's progress page now follows its stages over the job's event stream and no longer uses a meta refresh. bun test test/migrate.test.ts passes (15 tests). I couldn't run bun x tsc --noEmit here: bun can't write to its temp directory in this sandbox, so no type check was done.

Notes

stopped parked by the crew deploy 3948988

opened this

A migration's progress page now follows its stages over the job's event stream and no longer uses a meta refresh. bun test test/migrate.test.ts passes (15 tests). I couldn't run bun x tsc --noEmit here: bun can't write to its temp directory in this sandbox, so no type check was done.

What changed (src/web/pages/migrate.ts):

  • The page opens an EventSource on the existing GET /api/v1/migrate/:job/stream and updates each stage row's state, dot and detail as events arrive.
  • On done or failed it closes the stream and reloads. Done then redirects to the repository with the flash message. Failed stays as a page with the reason and "Try again".
  • refresh: { seconds: 2 } is gone, along with the old polling script that looked for the meta tag. A failed page loads no script at all.
  • Without JavaScript, the running page has a plain Reload link in a <noscript>.
  • No new route was added. The same-origin and owner checks are unchanged: the job page still uses migrationJobFor, and so does the stream.

Test (test/migrate.test.ts):

  • It runs running → done and running → failed over the real stream.
  • It checks that neither page has http-equiv="refresh".
  • It checks that another user gets 404 on both the page and the stream.
  • It checks that a failed page stands with its reason and no stream.

Left out: I didn't test the client script in a browser or against a DOM, only the markup and the stream contents.

To try: start a migration at /migrate. The job page updates its stages without reloading and lands on the repository when it finishes.

🤖 Generated with Claude Code

Closes #3163

commented

A migration's progress page now follows its stages over the job's event stream and no longer uses a meta refresh. bun test test/migrate.test.ts passes (15 tests). I couldn't run bun x tsc --noEmit here: bun can't write to its temp directory in this sandbox, so no type check was done.

What changed (src/web/pages/migrate.ts):

  • The page opens an EventSource on the existing GET /api/v1/migrate/:job/stream and updates each stage row's state, dot and detail as events arrive.
  • On done or failed it closes the stream and reloads. Done then redirects to the repository with the flash message. Failed stays as a page with the reason and "Try again".
  • refresh: { seconds: 2 } is gone, along with the old polling script that looked for the meta tag. A failed page loads no script at all.
  • Without JavaScript, the running page has a plain Reload link in a <noscript>.
  • No new route was added. The same-origin and owner checks are unchanged: the job page still uses migrationJobFor, and so does the stream.

Test (test/migrate.test.ts):

  • It runs running → done and running → failed over the real stream.
  • It checks that neither page has http-equiv="refresh".
  • It checks that another user gets 404 on both the page and the stream.
  • It checks that a failed page stands with its reason and no stream.

Left out: I didn't test the client script in a browser or against a DOM, only the markup and the stream contents.

To try: start a migration at /migrate. The job page updates its stages without reloading and lands on the repository when it finishes.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("no polling in src/web > every allowlisted file exists, says why, and still uses what it is allowed") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs