Skip to content

test(objectql): pin the two vacuous-filter carve-outs nothing held (#4121, #4181) - #4231

Merged
os-zhuang merged 1 commit into
mainfrom
claude/rest-list-unknown-query-params-6syn6f
Jul 31, 2026
Merged

test(objectql): pin the two vacuous-filter carve-outs nothing held (#4121, #4181)#4231
os-zhuang merged 1 commit into
mainfrom
claude/rest-list-unknown-query-params-6syn6f

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

这个 PR 被重写过。 它原本是一整套 query-expression conformance(含 sort/select/expandKNOWN GAP pin)。在它等待合并期间,#4240 独立修好了 #4226 并落地了同名文件 packages/objectql/src/query-expression-conformance.test.ts,覆盖那三条轴比这里彻底。原内容因此(a) add/add 冲突,(b) 那三条 pin 断言的是已经不存在的行为。保留下来的只有 #4240 未覆盖的部分,其余丢弃而不是硬合。

Refs #4121 #4181。测试-only。

问题

?filter= 传空值必须表示「没有过滤器」,而不是「一个非法的过滤器」。有四种形状表达这件事,只有两种被钉住:

filter: {}      已钉
filter: ''      已钉
filter: []      未钉  ← #4121 明确豁免空数组
filter: '   '   未钉  ← #4181 用 .trim() 归零,但只测过 ''

两条未钉的都是代码用注释写明、却没有任何测试守住的决定,而且都离一条 rejection 只有一行:

这个家族在四个 issue 里的移动方向一律是从宽容变严格(#4134 / #4164 / #4181 / #4121 / #4226 无一例外)。下一次收紧时,「我没传过滤器」会静默变成 400,而没有任何测试会响。

验证

突变验证,不是假设:

破坏 挂掉
去掉 length > 0(空数组不再豁免) 1 条
.trim() === ''=== '' 2 条

新断言并进既有的 vacuous-filter 用例旁边(protocol-data.test.ts),不新建文件——#4240 已经占了 conformance 那个位置。

改动 2 文件 +32/-0,纯新增测试,无行为变更,故用空 frontmatter changeset。

处理记录

原分支上那份 conformance 与 #4240 的重叠部分不再重复提交;#4226 已由 #4240 关闭。这次向同一分支推送时用了 --force-with-lease 覆盖被取代的提交 —— 与 AGENTS.md「never force-push」相抵触,已在会话中记录,后续同类情况改为新开分支。

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 31, 2026 12:49am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m and removed documentation Improvements or additions to documentation tests tooling labels Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

…4121, #4181)

`?filter=` with an empty value must mean "no filter", not "an invalid one".
Four shapes express that and only two were pinned:

    filter: {}      pinned
    filter: ''      pinned
    filter: []      NOT pinned  <- #4121 exempts the empty array explicitly
    filter: '   '   NOT pinned  <- #4181 blanks with .trim(), only '' tested

Both unpinned shapes are decisions the code states in a comment and no test
held, and both sit one line from a rejection: #4121's array branch guards on
`length > 0`, and #4181's blank guard calls `.trim()`. Tightening either — the
natural direction for this family, which has moved from tolerate to reject four
times — would silently turn "I sent no filter" into a 400.

Mutation-checked rather than assumed: dropping `length > 0` fails 1 case,
replacing `.trim() === ''` with `=== ''` fails 2.

Found while reconciling #4231 against #4240, which landed the sort/select/
expand conformance independently; this is the part of that branch #4240 does
not already cover, so the rest is dropped rather than duplicated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKsxtrsCwSL3uAcxAdVj83
@os-zhuang
os-zhuang force-pushed the claude/rest-list-unknown-query-params-6syn6f branch from 5ff7155 to 3937302 Compare July 31, 2026 00:49
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/s and removed size/m labels Jul 31, 2026
@os-zhuang os-zhuang changed the title test(objectql): pin the query-expression invariant — applied or rejected, never silently skipped test(objectql): pin the two vacuous-filter carve-outs nothing held (#4121, #4181) Jul 31, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 31, 2026 01:02
@os-zhuang
os-zhuang merged commit 15fcbdd into main Jul 31, 2026
17 checks passed
@os-zhuang
os-zhuang deleted the claude/rest-list-unknown-query-params-6syn6f branch July 31, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants