fix(service-datasource): reject a pool block the memory arm cannot honour (#5931) - #6237
Merged
Merged
Conversation
…honour (#5931) #5714 made an unhonourable `pool` block a loud authoring error, but its ruling was scoped to the two sqlite arms — the `memory` arm kept dropping it. It hands `InMemoryDriver` nothing but `buildMemoryConfig(spec)`, which reads `spec.config` and never `spec.pool`, so a sized pool reached nothing and said nothing. `memory` now joins `POOL_UNSUPPORTED_DRIVER_IDS`, so all three doors that already rejected sqlite reject it: the Setup wizard's create/update, the boot-time auto-connect pre-pass, and the driver factory itself. Its own explanation, not SQLite's, per the maintainer ruling of 2026-08-07: SQLite is rejected because a second connection to `:memory:` opens a separate, empty database, which would split one datasource across several stores. That reasoning is false for `memory` — there is no connection at all — so reusing it would send the author looking for a connection-strategy knob that does not exist. Reasons are keyed by driver id, which makes an arm joining the set without writing one a type error. The sqlite arms' text is byte-for-byte unchanged (pinned whole). The pin #5954 deliberately left green (`leaves 'memory' out of the rejected set (#5931), deliberately`) is flipped rather than deleted — the same fact, re-judged — and the module note that named this issue as a known, deliberately drawn boundary now records the hole as closed. Out of scope, by the dispatch's red line: the spec half of the ruling (the four driver-qualified `pool` rows in `packages/spec/liveness/datasource.json`) goes to the spec seat on its own issue. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015a5qkLzpGXhLL2F5gvJ7dD
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckNo hand-written docs reference the 1 changed package(s). ✅ |
hotlong
marked this pull request as ready for review
August 7, 2026 11:41
This was referenced Aug 7, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #5931
按 2026-08-07 维护者裁决实施:
memory并入POOL_UNSUPPORTED_DRIVER_IDS,配 memory 专属消息,翻掉 #5954 特意留绿的钉。前提复核(基于
origin/main1549605)单子的前提全部成立,逐条对上:
default-datasource-driver-factory.tsmemory 臂只传buildMemoryConfig(spec);该函数只读spec.config,spec.pool从头到尾没人读。POOL_UNSUPPORTED_DRIVER_IDS确为['sqlite', 'sqlite-wasm'],模块注释「Where the boundary is, deliberately」第二条指名本单。datasource-pool-support.test.ts:59,标题leaves 'memory' out of the rejected set (#5931), deliberately。pool声明改为响亮拒绝,不再静默丢弃 (#5714) #5954 / fix(service-datasource): 补 vitest 超时配置覆盖空洞并复核 pool 用例并发隔离 (#6044) #6101(vitest.config.tstestTimeout: 60_000)均已在基线内,无冲突。改了什么
memory进入拒绝集合后,三扇门一起生效——它们本来就共用同一个 helper,不需要各改一处:Setup 向导 create/update、boot 期 auto-connect 预检、驱动工厂自身。消息是 memory 专属的,不复用 sqlite 那句。 这一条裁决讲得很明确,而且不是文风问题:sqlite 被拒是因为第二个
:memory:连接会打开另一个空库,按max分池等于把一个 datasource 的数据劈到几个库里;这套理由对memory是假的——它根本不开连接,存储就是本进程里的一个普通数据结构。照抄那句会告诉作者「驱动替你选了连接策略」,把人推去找一个不存在的旋钮。所以改成按驱动 id 取解释:顺带把「加臂必须写解释」做成结构约束:解释表
POOL_UNSUPPORTED_REASONS用Record< PoolUnsupportedDriverId, string >键控,往集合里加 id 却不写解释是类型错误,而不是悄悄借用隔壁那句。下一个姊妹臂按 #6140 的默认并入时会被这条挡住。sqlite / sqlite-wasm 两臂一个字没动。 不是靠 review 眼力保证的:新增一条整串 byte 级钉,字面量取自
origin/main改动前的文本;另跑探针直接对比改前改后两个实现的输出——sqlite518→518、sqlite-wasm523→523、better-sqlite3526→526,identical=true。那条钉是翻,不是删。 同一个事实换了裁决,所以保留它的位置和来历(注释说明它当初为什么被特意留绿),断言反过来,并把所有拼写(
inmemory/in-memory/mingo/ 大小写 / 两侧空格)一起钉住——它们resolveDriverId到同一个驱动。模块注释里指名本单的那段同步改写为「洞已闭」,并记下裁决顺带立的姊妹臂先例。行为变化
driver: 'memory'+ 非空pool从静默吞掉变成在到达的那扇门上抛错。删掉pool块即修好,且不损失任何东西——它此前配置的就是「无」。空pool: {}与不写pool的行为完全不变,memory 无 pool 照常构建(persistence: false的 #4083 形状原样保留)。全仓 +
examples/扫过:没有任何一处声明同时带memory和pool,兄弟仓(objectui / cloud)既不消费这个 helper 也没有这种声明。所以这是把一个可写、会被吞掉的 authoring 面关掉,不是打断谁今天在跑的东西。验证
datasource-pool-support.test.ts从 29 例增至 40 例。跨包扫的是规则的消费半径而不是被改的包:runtime与cli是真正会走 boot 预检那扇门的下游,所以整包跑了。反向验证(先定方向再跑):集合成员被拒绝谓词读取,所以预期方向是红——把
memory从集合里撤回,11 条新钉全红,失败信息正是该有的样子(expected [ 'sqlite', 'sqlite-wasm' ] to deeply equal [ 'memory', 'sqlite', 'sqlite-wasm' ]、promise resolved instead of rejecting等);同时类型闸也从另一头响了——'memory' does not exist in type Readonly< Record< "sqlite" | "sqlite-wasm", string > >,证明解释表的键控约束双向都拦得住。撤回操作已还原,未进入本 PR。范围
按派发红线执行:
packages/spec——packages/spec/liveness/datasource.json里pool四行的按驱动限定注记(本单 rider 登记的那半边)由 PM 另立转移单交 spec 座位,本 PR 一个字不碰。核过 fix(service-datasource): sqlite / sqlite-wasm 臂的pool声明改为响亮拒绝,不再静默丢弃 (#5714) #5954 同样没动 spec 侧,做法一致。driver-memory等)未碰:修复落点在 service-datasource 的工厂/helper。changeset:
@objectstack/service-datasourcepatch。取 patch 而非 #5954 的 minor,是因为本次没有新增任何导出——POOL_UNSUPPORTED_DRIVER_IDS/driverReadsDeclaredPool/unsupportedPoolIssue/unsupportedPoolMessage/assertDatasourcePoolSupported签名一律照旧,只是集合多了一个成员、消息多了一个分支。#5954 当时是 minor,因为那一版新建了这批公开 API。Generated by Claude Code