Repository navigation
fix(solid): an SSR async memo's retry runs under its own render's context (#3972) - #3983
Conversation
🦋 Changeset detectedLatest commit: 6f7aeba The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size (brotli, eager entry chunk)
|
Merging this PR will degrade performance by 8.39%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | createStore setter: delete + set one root key (#3044 overlay) |
1.8 ms | 2.1 ms | -11.36% |
| ❌ | memo + sync render effect only (reference) |
26.7 ms | 28.2 ms | -5.32% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix/ssr-retry-context-3972 (6f7aeba) with next (a24e911)
…text (#3972) The memo captured its render's sharedConfig.context at creation but `run` never reinstated it, so a retry (subscribePendingRetry -> update -> run) and everything it created ran under whichever concurrent render set the context last. Restore the captured context around the pass. Fix and repro by @ibniss. Fixes #3972 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LVm3wseHt9wRTY8LfPiHmQ
…olidjs/web in the #3972 spec Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LVm3wseHt9wRTY8LfPiHmQ
77d8e2c to
6f7aeba
Compare
Generated by Claude Code |
Coverage Report for CI Build 38172579889Coverage remained the same at 77.429%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
…own render's context (#3984) #3983 restored the creating render's sharedConfig.context around an async memo's retry. The render effect's retry (ctx.block(source.then(retry))) and a projection's re-derive (runProjection, re-run by settleServerAsync through subscribePendingRetry; also createStore(fn) and createOptimisticStore(fn)) captured the context at creation the same way and never reinstated it, so under concurrent requests the retry ran under whichever render set the context last. Both now set it around the pass, the render effect's around its effect run too. The #3972 spec gains one test per primitive: each pass, first and retry, sees its own render's context. The render effect, projection, createStore(fn) and createOptimisticStore(fn) cases fail on next. Claude-Session: https://claude.ai/code/session_017PDt8Jv6uf5xRDsrux4UwF Co-authored-by: Claude <noreply@anthropic.com>
Fixes #3972 — fix and repro by @ibniss, applied as proposed.
The server async memo captures its render's
sharedConfig.contextat creation ("async re-computations may run after a concurrent request has overwritten sharedConfig.context") butrunnever reinstated it. A retry (subscribePendingRetry→update→run), and everything the pass creates — achildren()memo it pulls, a slot's content — ran under whichever concurrent render set the context last, taking that render's hydration ids.runnow sets the captured context around the pass and restores the previous one.Test:
packages/web/test/server/retry-render-context-3972.spec.tsx(the issue's repro): two concurrent renders of a layout whosechildren()-resolved slot waits on data; each slot is created under its own render's context. Fails without the fix.Suites: web server config — the same 12 failures with and without the change (
link-claim,diagnostics-server-scenario,server-functions-adapter-request: local build/compiler environment);packages/solid— the same one environment failure (cross-package-fields, nouniversaldist here). Size: server renderToString floor unchanged.No public API change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LVm3wseHt9wRTY8LfPiHmQ
Generated by Claude Code