test(objectql): pin the two vacuous-filter carve-outs nothing held (#4121, #4181) - #4231
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckNo 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
force-pushed
the
claude/rest-list-unknown-query-params-6syn6f
branch
from
July 31, 2026 00:49
5ff7155 to
3937302
Compare
os-zhuang
marked this pull request as ready for review
July 31, 2026 01:02
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.
Refs #4121 #4181。测试-only。
问题
?filter=传空值必须表示「没有过滤器」,而不是「一个非法的过滤器」。有四种形状表达这件事,只有两种被钉住:两条未钉的都是代码用注释写明、却没有任何测试守住的决定,而且都离一条 rejection 只有一行:
where— reject it at the protocol instead #4121 的数组分支守在parsedFilter.length > 0上 —— 去掉这个条件,空数组就会被当成畸形过滤器拒绝;filterJSON 被静默忽略 —— 返回未过滤整页(#4134/#4164 家族第三员) #4181 的空白守卫是parsedFilter.trim() === ''—— 改成=== '',纯空白就会掉进JSON.parse然后 400。这个家族在四个 issue 里的移动方向一律是从宽容变严格(#4134 / #4164 / #4181 / #4121 / #4226 无一例外)。下一次收紧时,「我没传过滤器」会静默变成 400,而没有任何测试会响。
验证
突变验证,不是假设:
length > 0(空数组不再豁免).trim() === ''→=== ''新断言并进既有的 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」相抵触,已在会话中记录,后续同类情况改为新开分支。