You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c1b68d9
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat(signals): interactions wait for the handler's promise; UNTRACKED_ASYNC_HANDLER (#3604)
* feat(signals): an interaction waits for its handler's promise; UNTRACKED_ASYNC_HANDLER names the dead click no hold could judge
`onClick={async () => setResult(await save())}` returns a promise and
continues past the interaction frame. The record settled `idle` the moment
the handler returned, so the wait the person experienced — the whole
round-trip — was invisible to every verdict: no root write before the
`await` means no hold opened, and SILENT_HOLD judges holds.
`withInteraction` now hands the handler's return value to the engine
(`AttributionHooks.interactionEnd(returned)`); a thenable keeps the
`InteractionEvent` open until it settles either way, capped at 10s so a
promise that never settles cannot pin a record. The record carries
`continuationMs` (handler return → settle) and `settledMs` covers it, so a
consumer's span spans the wait. Writes in the continuation run with no
frame on the stack and stay unattributed; only the duration is claimed.
At settle, `UNTRACKED_ASYNC_HANDLER` fires when the handler took no other
road: no write before the await (a pending flag or optimistic value is the
acknowledgement, and its hold is SILENT_HOLD's to judge) and no `action()`
step under the frame (an action's steps stay attributed across yields).
Hold thresholds, since it is the same wait; off with `holds: false`. The
message carries the two repairs: make the work an action, or write the
pending state first.
Size: the tier +65 B (the return value through the seam), the engine
+384 B (the wait, the cap timer, the check and its text); caps moved with
notes. RFC 08 and the skill guide document the code; the plan records D1
and D2 as decided.
Co-Authored-By: Claude via Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
* test(signals): judge UNTRACKED_ASYNC_HANDLER's threshold on a test-owned clock
"stays quiet below the hold threshold, and info between the two" raced the
wall clock: a 1ms `await` had to settle under `infoMs: 10`, and on the
coverage-instrumented CI job (12× slower than a local run) it did not. The
engine reads `performance.now()` at the handler's return and at its
promise's settle, so the test now owns that clock (#3598's pattern): it
stands still unless the handler advances it — 9ms for the quiet side, 30ms
for the info side — and both `continuationMs` values are asserted exactly.
Real timers still drive the await; only the stamps are the test's.
Co-authored-by: Claude via Cursor <[email protected]>
* chore(size): re-measure the UNTRACKED_ASYNC_HANDLER engine note at landing
29,408 B against next's 29,018 on the rebased tree (+390 B, 42 B under the
29.45 KB cap); the PR's figures were taken on the pre-#3630 base.
Co-authored-by: Claude via Cursor <[email protected]>
---------
Co-authored-by: Claude via Cursor <[email protected]>
Co-authored-by: Claude via Cursor <[email protected]>
An interaction whose handler returns a promise stays open until it settles (`InteractionEvent.continuationMs`, `settledMs` covers the wait, 10s cap), and `UNTRACKED_ASYNC_HANDLER` names a handler that awaited past its frame with no write before the `await` and no `action()` — the dead click no hold could judge. `AttributionHooks.interactionEnd` receives the handler's return value.
Copy file name to clipboardExpand all lines: documentation/solid-2.0/08-dev-diagnostics.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -526,6 +526,14 @@ The hold _was_ acknowledged and still outlasted what a stale screen should carry
526
526
527
527
The design point: a hold is the stale-while-revalidate tool, right when the old screen stays useful for the wait. Past that, the honest UI is a fallback — which a `Loading` boundary provides only when it has not revealed yet or its `on` prop changed; a revealed boundary with no `on` keeps the old content, which _is_ the hold. So the repair is `on`, a fresh boundary, or making the data fast (preload, cache), never removing the acknowledgement. Silent long holds are not double-reported: they stay one `SILENT_HOLD` with the same repair appended. `feedback().sources[].long`/`longMs` counts long tails at the table level, acknowledged or not.
528
528
529
+
#### `UNTRACKED_ASYNC_HANDLER`
530
+
531
+
**Message:** "[click on button#save]'s handler awaited for 430ms after returning and wrote nothing before the await, so nothing on screen could show the wait and no hold was opened for the engine to judge — the interaction was dead for 430ms. Make the async work an `action()`: its steps stay attributed to this click across yields, the writes it makes are held and the hold is judged (`SILENT_HOLD`). Or write the pending state before the await — a `createOptimistic(false)` "saving" flag the UI reads."
532
+
533
+
The dead click that is not a hold. `onClick={async () => setResult(await save())}` returns a promise and continues past the interaction frame; the handler made no root write before its first `await`, so no hold opened, nothing could acknowledge one, and the engine's other verdicts never see the wait. `withInteraction` hands the handler's return value to the engine (`interactionEnd(returned)`); a thenable keeps the `InteractionEvent` open until it settles (either way — a rejection ended the wait too), capped at `ASYNC_HANDLER_CAP_MS` (10s) so a promise that never settles cannot pin a record. The record then carries `continuationMs` (handler return → settle) and `settledMs` covers it, so a consumer's interaction span spans the wait the person experienced. The continuation runs with no frame on the stack, so writes it makes are _not_ attributed to the interaction — only its duration is; the join for work dispatched synchronously in the handler (a `"call"` record's `origin`) is unchanged.
534
+
535
+
The finding fires at settle when the handler took no other road: no root write before returning (a write is the acknowledgement — a pending flag, an optimistic value — and its hold, if any, is judged by `SILENT_HOLD`), and no `action()` step under the frame (an action's steps stay attributed across yields and its holds are judged). Same thresholds as holds — it is the same wait: `info` from `holds.infoMs` (100ms), `warn` from `holds.warnMs` (200ms); off with `holds: false`. `data`: `interaction` (`type`, `target`), `continuationMs`, `capped`. No subject: an interaction has no node.
536
+
529
537
### Server rendering (`ssr`, `head`)
530
538
531
539
The server runtime reports on the same channel. Two groups, two tiers. **Findings** are facts about a render whichever tier is running — an error a boundary contained, work the stream threw away, an error the server-function wire replaced. They ride `OBSERVE.diagnostics` in observe and dev builds (a production observability consumer subscribes to them; in dev they also print) and fold out of prod entirely. **Checks** are guidance for a developer at a console — a write on the server, an invalid preload descriptor — and exist only in the dev build, where they print like any client warning. Every entry carries `ownerPath` when it fired inside a component: on the server the component wrapper labels its owner `<Name>` exactly as the client's does, so `in <App> › <Page>` reads the same on both sides. Codes that already exist on the client (`ASYNC_OUTSIDE_LOADING_BOUNDARY`, `UNRECOGNIZED_INSERT_VALUE`) are shared, not duplicated; `data.side` or the message tells the platforms apart where it matters.
@@ -844,6 +852,7 @@ The runtime derives a request's trace itself in every tier — the W3C `tracepar
|`SILENT_HOLD`| info/warn | responsiveness | Write held 100ms+/200ms+ by pending async with no on-screen acknowledgement (attribution enabled) |
846
854
|`LONG_HOLD`| info/warn | responsiveness | Acknowledged hold whose tail (last input → commit) ran 500ms+/1000ms+ (attribution enabled) |
855
+
|`UNTRACKED_ASYNC_HANDLER`| info/warn | responsiveness | Handler awaited 100ms+/200ms+ past its frame with no write before the `await` and no `action()`: a dead click no hold could judge (attribution enabled) |
847
856
|`SSR_RENDER_ERROR_CONTAINED`| error | ssr | Server render error routed by a boundary: `data.handling` fallback / client / failed (observe + dev) |
848
857
|`SSR_SUBTREE_ABANDONED`| warn | ssr | A failed fragment's pending descendants were discarded (observe + dev) |
849
858
|`SSR_STREAM_ABANDONED`| warn | ssr | Response stream cancelled or sink failed with fragments pending (observe + dev) |
0 commit comments