Skip to content

fix(cli): report swallowed best-effort failures to Sentry - #1623

Merged
betegon merged 3 commits into
mainfrom
fix/report-swallowed-errors
Sep 22, 2026
Merged

betegon merged 3 commits into
mainfrom
fix/report-swallowed-errors

Conversation

@betegon

@betegon betegon commented Sep 22, 2026

Copy link
Copy Markdown
Member

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 in resolveEffectiveOrg still only log.debug, because the command-boundary error is already reported.

Also treats empty dsn_cache rows (dsn="" from a scan that found nothing) as misses on the single-DSN path, so detectDsn() 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.ts
  • A 500 from tryGetPrimaryDsn shows up as a Sentry issue; a 404 does not
  • detectDsn() in a repo with no DSN does not treat an empty cache row as a hit

Made with Cursor

betegon and others added 2 commits September 22, 2026 16:26
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>
@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Sep 22, 2026 4:23pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Sep 22, 2026 4:23pm UTC

Request Review

@betegon
betegon marked this pull request as ready for review September 22, 2026 16:02
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 22, 2026
Patch coverage missed the listProjects/seedProjectCaches cache-failure
catches and the resolveEffectiveOrg slug fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
vercel Bot temporarily deployed to Preview – sentry-local September 22, 2026 16:23 Inactive
@betegon
betegon merged commit e3fddc2 into main Sep 22, 2026
37 checks passed
@betegon
betegon deleted the fix/report-swallowed-errors branch September 22, 2026 16:58

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli 502602ed Deployed Sep 22, 2026 by vercel[bot]
Preview – sentry-local 502602ed Deployed Sep 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant