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

The app page's run log tail appends run.log frames from /events and opens no EventSource of its own #2854

shipped production is serving it opened this has it
opened this

Replaces #2844. The run.log frame on /events is on main (#2845). Both earlier pulls (#2849, #2850) were right in shape and failed only the type check: test/app-tail-events.test.ts(36,5): error TS2722: Cannot invoke an object which is possibly 'undefined'. Guard the optional handler in the test (handler?.(...) or an expect(handler).toBeDefined() and a non-null narrowing), and run bun x tsc --noEmit and bun test test/app-tail-events.test.ts test/map.test.ts before you push.

Done looks like:

  • [ ] The app page's log tail (studioRunJs in src/web/client.ts, the new EventSource(url) near line 436) appends lines from run.log frames for its run over the one /events connection. The per-run stream URL is no longer opened from that script.
  • [ ] connect() keeps the literal new EventSource('/events') that test/map.test.ts asserts. The mirror stream (client.ts:126) is left alone.
  • [ ] A test fails without the change: the tail script opens no EventSource besides /events, and a run.log frame for the run appends its lines once.
  • [ ] bun x tsc --noEmit is clean.

Files: src/web/client.ts, test/app-tail-events.test.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs