Skip to content

fix: toolbar no longer freezes the tab during an action that refreshes - #53

Merged
ryansolid merged 2 commits into
mainfrom
claude/project-thread-9q89yi
Nov 19, 2026
Merged

ryansolid merged 2 commits into
mainfrom
claude/project-thread-9q89yi

Conversation

@ryansolid

Copy link
Copy Markdown
Member

This PR was written by Claude Code (an AI agent) on behalf of @ryansolid.

Requested-by: @ryansolid

Summary

Fixes solidjs/solid#5038. With DevToolbar mounted, an action that calls a server function and then runs refresh(data) froze the tab.

The timeline and async trackers run on every runtime record, including every flush record, and then write their list back on a microtask. The toolbar's write lands in the same tick in which the action's step resumes, so the action's transaction adopts it (D-7) and the signal is held. When a write goes to a held slot it joins the hold even if the value is equal (D-8), and so it schedules a flush. That flush is empty, but it still emits a flush record. The record runs the tracker, which writes the same list again, and the microtask queue never empties. The request's timer never runs, so the action never ends.

The fix is to write a list only when the tracker returns a new one. TimelineBuilder.snapshot() and AsyncHistory.records already keep the same array while nothing changed, so an empty flush now writes nothing. This needs no change in Solid core.

There is also a core-side fix, solidjs/solid#5045 by @brenelz. It stops an equal rewrite of a held slot from scheduling a flush. Its size gate currently fails, at +28 to +118 B brotli on the live and every-store pages. This PR keeps the toolbar from freezing whether or not that one lands.

A second commit fixes the build on main. terracotta 2.0.0 ships .jsx, and the build skipped all of node_modules. Rolldown's default React transform compiled those files instead, so dist imported react/jsx-runtime. The Solid compiler now handles terracotta/dist.

How did you test this change?

  • New e2e test keeps the page running while an action refreshes a load. The fixture renders it only on ?refresh-action, so the other tests see the same app as before. The action yields a timer request that ends with a call record, the way the server function runtime sends one, and then refreshes an async memo. The test clicks twice and expects served 1 and then served 2.
    • Without the fix it fails: the page stops responding after the first click.
    • With the fix it passes.
  • Full e2e suite: 30 passed. Unit tests: 339 passed. pnpm typecheck is clean, and oxfmt is clean on the changed files.
  • Reproduced the issue's app with @solidjs/vite-plugin (start: { devtools: true }, a real 'use server' function, action + refresh). It hangs on the first click with the published 1.0.0 and with a local build of main. With this branch it counts 0, 1, 2, 3 and timers keep running.

Generated by Claude Code

terracotta 2.0.0 ships .jsx files. The build skipped everything under
node_modules, so rolldown's default React transform compiled them and
dist imported react/jsx-runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWNquaFeeLesV4k9P3K
The trackers wrote their list back after every flush record. While a
pending action held the toolbar's signal, rewriting the same list still
scheduled a flush, whose record ran the tracker again, and the tab froze
(solidjs/solid#5038).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWNquaFeeLesV4k9P3K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DevToolbar causes the browser tab to become unresponsive when an action refreshes a memo

2 participants