Skip to content

fix: add missing mode field to Convex where validators#326

Closed
rit3sh-x wants to merge 1 commit into
get-convex:mainfrom
rit3sh-x:fix/adapter-mode-validator
Closed

fix: add missing mode field to Convex where validators#326
rit3sh-x wants to merge 1 commit into
get-convex:mainfrom
rit3sh-x:fix/adapter-mode-validator

Conversation

@rit3sh-x

@rit3sh-x rit3sh-x commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Better Auth now sends a mode field (sensitive | insensitive) in where clauses
  • The Convex validators in adapterWhereValidator and whereValidator did not accept this field,
    causing 111 test failures
  • Added mode as an optional field to both validators

Changes

  • src/client/adapter-utils.ts — added mode to adapterWhereValidator
  • src/client/create-api.ts — added mode to local whereValidator

Test plan

  • All 165 tests passing (previously 111 failing)
  • No type errors
  • Lint clean

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this
contribution, under the terms of your choice.

Summary by CodeRabbit

  • New Features
    • Query filters now support an optional mode parameter to specify case-sensitive ("sensitive") or case-insensitive ("insensitive") string matching.

  Better Auth now sends a mode (sensitive | insensitive) field in
  where clauses. The Convex validators rejected it as an unexpected field,
  causing 111 test failures. Add mode as an optional field to both
  adapterWhereValidator and whereValidator.
@vercel

vercel Bot commented Apr 9, 2026

Copy link
Copy Markdown

@rit3sh-x is attempting to deploy a commit to the Convex Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6eb22fc5-c3da-496f-a678-8d4cd4598c60

📥 Commits

Reviewing files that changed from the base of the PR and between 8587abc and b6680ce.

📒 Files selected for processing (2)
  • src/client/adapter-utils.ts
  • src/client/create-api.ts

📝 Walkthrough

Walkthrough

Two validator schemas are updated to include an optional mode field restricted to "sensitive" and "insensitive" literals on where objects, ensuring consistency between adapter and API validators.

Changes

Cohort / File(s) Summary
Where Validator Enhancement
src/client/adapter-utils.ts, src/client/create-api.ts
Added optional mode: "sensitive" | "insensitive" field to where clause validators for consistency across adapter and create-api validators.

Possibly related issues

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐰 Two validators now hum in perfect tune,
Where clauses gain modes—insensitive or soon—
Sensitive choices bloom in the schema's light,
Adapter and API dancing in sync tonight! 🌙✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add missing mode field to Convex where validators' directly and accurately summarizes the main change: adding a missing mode field to where clause validators in Convex.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stevebrainng

Copy link
Copy Markdown

How fast can this be merged?

@erquhart

Copy link
Copy Markdown
Member

Thanks for this - closing in favor of #323.

@erquhart erquhart closed this Apr 24, 2026
@rit3sh-x rit3sh-x deleted the fix/adapter-mode-validator branch April 24, 2026 04:46
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.

3 participants