fix: stop Vercel translator silently mapping unsupported operators to eq - #279
Merged
Conversation
mapUnifiedOperatorToVercel only mapped 8 of the 15 unified Operator
values; ne/not_contains/not_in/gt/ge/lt/le fell through `mapping[op] ||
'eq'` with no warning, silently rewriting what a rule matches. A
condition meaning "method is not POST" (ne) translated to Vercel's
plain "method is POST" (eq) -- the literal opposite, with nothing
anywhere flagging it. Vercel is doorman's documented "stable" provider,
so this was the adapter users are most likely to trust without extra
scrutiny.
ne/not_contains/not_in are representable on Vercel -- it has no
dedicated negative operators, only a positive operator + `neg` flag
(the same mechanism `not_exists` already uses via `nex`) -- so these
now map to their positive operator with `forceNeg: true`, composed via
XOR with the condition's own independent `negated` flag rather than
just overwriting it (so a hand-authored `{operator: 'ne', negated:
true}` correctly cancels back to plain equality instead of a
nonsensical double-negative).
gt/ge/lt/le have no Vercel equivalent at all -- Vercel's operator
vocabulary (eq, pre, suf, inc, sub, re, ex, nex) has no numeric
comparison concept -- so these now drop the condition and emit a
critical TranslationWarningSystem warning instead of silently
substituting eq, mirroring the existing unmapped-field warning path in
the same function.
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 24, 2026
## [3.15.3](v3.15.2...v3.15.3) (2026-08-24) ### Bug Fixes * stop Vercel translator silently mapping unsupported operators to eq ([#279](#279)) ([3bc17f1](3bc17f1))
|
🎉 This PR is included in version 3.15.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
gfargo
added a commit
that referenced
this pull request
Aug 25, 2026
…) are fixed (#282) ne/not_contains/not_in and allow/block were documented as known-bugs to avoid on Vercel; both are now correctly handled (neg-flag composition and bypass/deny remapping respectively, per #279/#280). gt/ge/lt/le remain a genuine platform gap -- Vercel has no numeric-comparison operator at all -- but that's now a documented, safe drop-with-warning rather than a silent bug to avoid.
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 #261
Summary
mapUnifiedOperatorToVercelonly mapped 8 of the unifiedOperatortype's 15 values.ne,not_contains,not_in,gt,ge,lt,lefell throughmapping[op] || 'eq'with no warning, silently rewriting what a rule matches — sometimes inverting it outright. A condition meaning "method is not POST" (ne) translated to Vercel's plain "method is POST" (eq), the literal opposite, with nothing anywhere flagging it. Vercel is doorman's documented "stable" provider, so this is the adapter users are most likely to trust without extra scrutiny.Two different fixes for two different reasons:
ne/not_contains/not_inare representable on Vercel. It has no dedicated negative operators, only a positive operator + anegflag (the same mechanismnot_existsalready uses vianex). These now map to their positive operator withforceNeg: true, composed via XOR with the condition's own independentnegatedflag rather than overwriting it — so a hand-authored{operator: 'ne', negated: true}(double negation) correctly cancels back to plain equality instead of producing a nonsensical result.gt/ge/lt/lehave no Vercel equivalent at all. Vercel's operator vocabulary (eq, pre, suf, inc, sub, re, ex, nex) has no numeric-comparison concept — there's nothing to fall back to, so these now drop the condition and emit a criticalTranslationWarningSystemwarning instead, mirroring the existing unmapped-field warning path already in the same function.Test plan
pnpm compile && pnpm test && pnpm lintall pass (1779 tests, 0 lint errors)