Skip to content

fix: reject nested where clauses on missing fields#1755

Open
LaplaceYoung wants to merge 2 commits intotypicode:mainfrom
LaplaceYoung:fix/nested-where-missing-fields
Open

fix: reject nested where clauses on missing fields#1755
LaplaceYoung wants to merge 2 commits intotypicode:mainfrom
LaplaceYoung:fix/nested-where-missing-fields

Conversation

@LaplaceYoung
Copy link
Copy Markdown

@LaplaceYoung LaplaceYoung commented Apr 28, 2026

Summary

  • Treat nested _where predicates with missing or non-object intermediate fields as mismatches when they contain known operators.
  • Preserve existing compatibility for unknown operator objects that do not contain known _where operators.
  • Add regression coverage for missing nested fields, primitive intermediate fields, or clauses, and the GET /posts?_where=... request path.

Verification

  • pnpm exec node --experimental-strip-types --test src/app.test.ts src/matches-where.test.ts
  • pnpm test
  • pnpm typecheck
  • pnpm lint
  • pnpm exec oxfmt --check src/app.test.ts src/matches-where.ts src/matches-where.test.ts
  • pnpm exec tsc
  • issue reproduction command now prints strict [] and bypass []
  • git diff --check

pnpm build reaches the package script and fails on Windows because rm -rf lib is not available in PowerShell. pnpm exec tsc was used to verify the TypeScript build step directly.

Fixes #1731

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail-open nested _where filtering

1 participant