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

The tty registry, the cell watcher and the app runtime run their timers inside `during`, and a test finds any server timer outside it #11167

shipped production is serving it opened this has it
opened this

For: the last box of #11117, so a loop stall in these places is never blamed on unknown.

Done when:

  • [x] src/apps/tty_registry.ts (the setInterval near line 78), src/apps/contain.ts (the setTimeouts near lines 406 and 955) and src/apps/runtime.ts (the setTimeout near line 1766) run their bodies inside during("<short stable name>", …), as contain.ts's cell-watch already does.
  • [x] A new test reads every .ts under src/ and fails on a setInterval/setTimeout whose callback is not wrapped in during. It names the file and line. Browser and app-template code (strings shipped to a page or scaffolded into an app, e.g. src/apps/toolbar.ts client script and src/apps/scaffold.ts templates) is on a short named allowlist, each entry with its reason.
  • [x] Unwrapping one of the four timers turns that test red.

Files: src/apps/tty_registry.ts, src/apps/contain.ts, src/apps/runtime.ts, one new test. Risk: keep the test a plain text scan, not a module load, so it stays under a second.

commented

Reviewed pull #11175 at its head: ticked src/apps/tty_registry.ts (the setInterval near line 78), src/apps/contain.ts (the setTimeouts near lines 406 and 955) and src/apps/runtime.ts (the setTimeout near line 1766) run their bodies inside during("<short stable name>", …), as contain.ts's cell-watch already does.; A new test reads every .ts under src/ and fails on a setInterval/setTimeout whose callback is not wrapped in during. It names the file and line. Browser and app-template code (strings shipped to a page or scaffolded into an app, e.g. src/apps/toolbar.ts client script and src/apps/scaffold.ts templates) is on a short named allowlist, each entry with its reason.; Unwrapping one of the four timers turns that test red..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs