fix(auth): avoid negative-caching transient user-key failures#5599
Open
JacobisEpic wants to merge 3 commits into
Open
fix(auth): avoid negative-caching transient user-key failures#5599JacobisEpic wants to merge 3 commits into
JacobisEpic wants to merge 3 commits into
Conversation
|
@JacobisEpic is attempting to deploy a commit to the World Monitor Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Fixes #5384.
Distinguishes definitive invalid user API keys from transient or indeterminate Convex validation failures.
Previously, Convex 5xx responses, timeouts, missing configuration, and genuine unknown keys could all collapse into the same
nullresult.The cache layer interpreted that result as definitively invalid and stored the negative sentinel for 60 seconds.
This change preserves negative caching for genuine unknown keys while ensuring transient validation failures remain retryable.
Type of change
Affected areas
/api/*)Checklist
api/rss-proxy.jsallowlist (not applicable)npm run typecheck)Documentation Alignment Checklist
N/A - backend authentication/cache behavior only; no published documentation claims or generated artifacts changed.
Validation
./node_modules/.bin/vitest run server/__tests__/user-api-key-validation.test.ts server/__tests__/user-api-key-negative-cache.test.ts- 2 files, 32 tests passed../node_modules/.bin/tsx --test tests/redis-caching.test.mjs- 10 suites, 40 tests passed.npm run test:convex- 56 files, 1,005 tests passed.node --test api/_api-key.test.mjs api/_user-api-key.test.mjs- 77 tests passed../node_modules/.bin/tsx --test tests/mcp-user-key-auth.test.mjs tests/mcp-usage-telemetry.test.mjs tests/premium-stock-gateway.test.mts- 5 suites, 40 tests passed../node_modules/.bin/biome check server/_shared/redis.ts server/_shared/user-api-key.ts server/__tests__/user-api-key-negative-cache.test.ts tests/redis-caching.test.mjs- 4 files passed.npm run typecheck:api- passed.npm run typecheck- passed.bash .husky/pre-push- all change-scoped gates passed, including 107 server handler tests and 40 changed-file cache tests.No unrelated baseline failures.
Screenshots
N/A - backend authentication/cache behavior only.