This repository was archived by the owner on Oct 21, 2026. It is now read-only.
Repository navigation
fix(solid-start): answer each Convex query once per server render - #5
Merged
Merged
Conversation
Solid 2 resolves a <Loading> on the server by re-running its children; the per-request reader issued a new HTTP query, and a new pending promise, on every pass, so boundary discovery could fail to converge (10001 passes), the Worker exceeded its CPU limit and the document was cut off after the shell. Production builds only. Evidence: celados/delta#160. Why: templates/solid-start/web/src/lib/convex-server.ts#createServerConvex | query must return the same promise per function+args for the request; a fresh promise per call makes SSR <Loading> discovery never converge (prod build only)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
querySource在服务端每次调用都走locals.convex.query(),而 per-request reader 每次都发一个新的 HTTP 查询、返回一个新的 pending Promise。Solid 2 SSR 通过反复重跑<Loading>的 children 来发现边界,每一轮都拿到新的 pending 值,某些页面下永不收敛(did not converge after 10001 passes),Worker 超 CPU 限额,HTML 流在 shell 之后被截断。只在 production build 出现,vite dev不复现。证据:celados/delta 的 whiteboard
/studio/account白屏,修复见 https://github.com/celados/delta/pull/160 。本 PR 把同一修复移植回模板。改动
web/src/lib/convex-server.ts:per-request 的answersMap,按函数名 + convexToJson(args)去重,同一次渲染里同一个问题返回同一个 Promise。convex.ts无需改动。web/src/lib/convex-server.test.tsx:回归测试(同一问题返回同一 Promise、只发一次 HTTP 请求;不同问题各自请求)。Solid 版本未动(rc.10)。
验证
bun run check通过(format / lint / typecheck / web 15 tests / extension 24 tests / deadcode)。expected Promise{…} to be Promise{…} // Object.is equality),恢复后通过。