fix(cli): report swallowed best-effort failures to Sentry - #1623
Merged
Merged
Conversation
setCachedDetection() writes dsn="" when no DSNs are found. getCachedDsn() returned those rows as hits, so detectDsn() wasted work verifying a bogus entry. Co-authored-by: Cursor <cursoragent@cursor.com>
Debug logs only show up with --verbose, which users never pass. Route cache, DSN, and per-region lookup failures through reportCliError so unexpected errors become issues. Org-resolution fallbacks still only log, because the command-boundary error is already captured. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
betegon
marked this pull request as ready for review
September 22, 2026 16:02
Patch coverage missed the listProjects/seedProjectCaches cache-failure catches and the resolveEffectiveOrg slug fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch was successfully deployed
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
Swallowed best-effort failures (project cache writes, DSN key fan-out,
tryGetPrimaryDsn) were either silent or only visible with--verbose. Users never pass that, so those errors never showed up as Sentry issues.Those catches now go through
reportCliError: unexpected failures become issues, and network/auth/4xx still get silenced. Org-resolution fallbacks inresolveEffectiveOrgstill onlylog.debug, because the command-boundary error is already reported.Also treats empty
dsn_cacherows (dsn=""from a scan that found nothing) as misses on the single-DSN path, sodetectDsn()doesn't verify a poisoned cache hit.Alternative to #1433, which only added debug logs.
Test plan
pnpm exec vitest run test/lib/db/dsn-cache.test.ts test/lib/api/projects.test.ts test/lib/api-client.coverage.test.ts test/lib/api-client.multiregion.test.ts test/lib/resolve-effective-org.test.tstryGetPrimaryDsnshows up as a Sentry issue; a 404 does notdetectDsn()in a repo with no DSN does not treat an empty cache row as a hitMade with Cursor