fix: three defensive bug fixes (trace logs per_page, silent catches in set-commits & resolve-target)#1228
Draft
cursor[bot] wants to merge 3 commits into
Draft
fix: three defensive bug fixes (trace logs per_page, silent catches in set-commits & resolve-target)#1228cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
… hasMore logic listTraceLogs passed options.limit (up to 1000) directly as per_page to the API, which silently caps at 100. The hasMore logic in trace/logs.ts compared logs.length >= flags.limit, which would evaluate incorrectly (e.g., 100 >= 200 → false) hiding available data from the user. Fix: cap per_page at Math.min(limit, API_MAX_PER_PAGE) in the API function, and compute hasMore against the effective per-page value. Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
…mmits Three catch blocks in the repo integration cache helpers silently swallowed errors with only inline comments. When DB operations fail (e.g., SQLITE_BUSY, disk full), the error vanished without a trace, making debugging impossible. Fix: add log.debug() calls so errors appear in verbose output while remaining non-blocking for normal operation. Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
Three catch blocks in resolve-target.ts silently swallowed errors, making it impossible to debug org resolution, project search, and DSN auto-detection failures. Users hitting network or auth issues in these paths got empty results with no diagnostic trail. Fix: add log.debug() calls so errors appear in verbose output (SENTRY_LOG_LEVEL=debug) while preserving the graceful degradation. Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
Contributor
|
Contributor
Codecov Results 📊❌ Patch coverage is 37.50%. Project has 5342 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 81.82% 81.80% -0.02%
==========================================
Files 423 423 —
Lines 29343 29350 +7
Branches 19118 19118 —
==========================================
+ Hits 24008 24008 —
- Misses 5335 5342 +7
- Partials 1989 1987 -2Generated by Codecov Action |
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
Three independent defensive bug fixes discovered through codebase audit:
1.
trace logsper_page exceeds API max andhasMoreis wrongRoot cause:
listTraceLogs()sent the raw--limitvalue (up to 1000) asper_pageto the Sentry API, which silently caps at 100. ThehasMorelogic comparedlogs.length >= flags.limit(e.g.,100 >= 200 = false), hiding available data.Reproduction:
sentry trace logs --limit 200 <trace-id>returns 100 items but says no more are available.Fix: Cap
per_pageatMath.min(limit, API_MAX_PER_PAGE)inlistTraceLogs, and computehasMoreagainst the effective per-page value.Files:
src/lib/api/logs.ts,src/commands/trace/logs.ts2. Silent catch blocks in
release/set-commits.tsRoot cause: Three catch blocks in the repo integration cache helpers silently swallowed errors with only inline comments. When DB operations fail (SQLITE_BUSY, disk full), errors vanish without a trace, making debugging impossible.
Reproduction: Any DB failure in
hasNoRepoIntegration,cacheNoRepoIntegration, orclearRepoIntegrationCache— the error is invisible.Fix: Add
log.debug()calls so errors appear in verbose output while remaining non-blocking.Files:
src/commands/release/set-commits.ts3. Silent catch blocks in
resolve-target.tsRoot cause: Three catch blocks in the target resolution module silently swallowed errors: numeric org resolution failures, similar-project search failures, and DSN auto-detection failures. Users hitting network or auth issues got empty results with no diagnostic trail.
Reproduction: Any network/auth failure in
normalizeNumericOrg,findSimilarProjectsAcrossOrgs, or the DSN auto-detection fallback path — the error is invisible.Fix: Add
log.debug()calls so errors appear in verbose output (SENTRY_LOG_LEVEL=debug) while preserving graceful degradation.Files:
src/lib/resolve-target.ts