Skip to content

fix: keep the devtools' own reads of the app out of Health - #57

Open
devagrawal09 wants to merge 1 commit into
solidjs:mainfrom
devagrawal09:fix/quiet-devtools-reads
Open

devagrawal09 wants to merge 1 commit into
solidjs:mainfrom
devagrawal09:fix/quiet-devtools-reads

Conversation

@devagrawal09

Copy link
Copy Markdown

What and why

Run devtools registry walks, change counters, and dev-hook listeners through Solid's untrack, and exclude diagnostics raised during those reads from Health. Reading runtime fields through a store proxy inside an app's strict-read scope could otherwise attribute the devtools' own STRICT_READ_UNTRACKED warnings to the app.

Tests

Added regression coverage for devtools reads in a strict-read scope. pnpm format:check, pnpm build, pnpm typecheck, pnpm test (341 passed), pnpm check, and pnpm test:e2e (30 passed) all passed.

The graph and the tree read runtime node fields such as `_flags` and
`_time`. The runtime lists a store's proxy beside plain signals, so those
reads went through the proxy, and inside a strict-read scope of the app,
such as an effect callback, each one was reported as STRICT_READ_UNTRACKED
against the app.

The registry walks, the change counters and the dev-hook listeners now run
in `quietly`, which reads through Solid's `untrack` (it closes the
strict-read window) and marks the read as the devtools'. Health drops
anything the runtime reports while such a read runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@lxsmnsyc lxsmnsyc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. The problem is real and the untrack part works. Two items to resolve before approval.

Proof (run locally in review worktrees)

  • I copied the first test in src/dev-toolbar/quiet.dev.test.ts without the quietly import. On main it fails: the strict-read warnings received are _config, _flags, _name, _statusFlags, _subs, _time, _value, _x. On this branch it passes.
  • The same test with the store removed passes on main. So the store is needed for the symptom, which matches the changeset.
  • Full local run on the branch: 341 tests pass, format passes. CI is green (3 of 3). pnpm build and pnpm typecheck fail locally on both main and this branch (TS2883 and missing @solidjs/start-devtools types), so I could not use them. CI covers them.
  • Size: +3.0kB raw, +1.5kB gzip across dist, mostly the new quiet chunk (1.1kB).

Should fix

  1. src/dev-toolbar/issues/tracker.ts:123 (if (isQuiet()) return;) is not tested against a real devtools read. The first test subscribes to OBSERVE.diagnostics directly, so it passes through untrack alone. If I remove this line, only the second test fails, and that test builds a strict-read scope inside quietly by hand. Please show a real devtools read that still raises a finding after untrack. If there is none, drop the filter and isQuiet. As written it also hides any real app finding raised while a dev-hook listener runs, for example inside onOwner.
  2. .changeset/quiet-devtools-reads.md: the list "_flags, _time, _subs and _config" is incomplete. On main the test also reports _name, _statusFlags, _value and _x. Say "such as", or list all of them. The sentence "on a store those reads went through its proxy" is the cause. I confirmed only that the warnings need a store in the app. I did not confirm the proxy path. Either keep it as "with a store in the app" or add the evidence.

Nits

  • src/dev-toolbar/quiet.ts comment says "the runtime lists them beside plain signals". Say where (which registry list) so the next reader can check it.
  • Other devtools reads of node fields are not wrapped: activity/model.ts:898 (_value), activity/detail.tsx:308. They run from UI code, not inside app scopes, so this is probably fine. Please confirm.

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.

2 participants