From caa1379fc7147c540bb693568afa9b14e0b58711 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 3 Aug 2026 12:06:44 +0000 Subject: [PATCH 1/3] fix(react-native): guard JSON.parse of sourcemap report file (Sentry CLI-RN-XCODE) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miguel Betegón --- packages/cli/src/commands/react-native/xcode.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/commands/react-native/xcode.ts b/packages/cli/src/commands/react-native/xcode.ts index 89a976c79a..697b296274 100644 --- a/packages/cli/src/commands/react-native/xcode.ts +++ b/packages/cli/src/commands/react-native/xcode.ts @@ -240,9 +240,13 @@ function runWrappedBuild( const status = runScript(script, scriptArgs, env); - const report = JSON.parse( - readFileSync(reportPath, "utf-8") - ) as SourceMapReport; + let report: SourceMapReport; + try { + report = JSON.parse(readFileSync(reportPath, "utf-8")) as SourceMapReport; + } catch (error) { + log.debug("Failed to read sourcemap report file", error); + return { status, pair: null }; + } if (!(report.packager_bundle_path && report.packager_sourcemap_path)) { return { status, pair: null }; } From 2543fcc0aef282b431ac85aa24faac39795caf5d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 3 Aug 2026 12:08:11 +0000 Subject: [PATCH 2/3] fix(upgrade): wrap response.json() to catch non-JSON responses (Sentry CLI-UPGRADE) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miguel Betegón --- packages/cli/src/lib/upgrade.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/lib/upgrade.ts b/packages/cli/src/lib/upgrade.ts index 00a8301bf2..ec99d606b9 100644 --- a/packages/cli/src/lib/upgrade.ts +++ b/packages/cli/src/lib/upgrade.ts @@ -390,7 +390,15 @@ export async function fetchLatestFromGitHub( ); } - const data = (await response.json()) as { tag_name?: string }; + let data: { tag_name?: string }; + try { + data = (await response.json()) as { tag_name?: string }; + } catch { + throw new UpgradeError( + "network_error", + "GitHub returned non-JSON response" + ); + } if (!data.tag_name) { throw new UpgradeError( @@ -422,7 +430,15 @@ export async function fetchLatestFromNpm(): Promise { ); } - const data = (await response.json()) as { version?: string }; + let data: { version?: string }; + try { + data = (await response.json()) as { version?: string }; + } catch { + throw new UpgradeError( + "network_error", + "npm registry returned non-JSON response" + ); + } if (!data.version) { throw new UpgradeError("network_error", "No version found in npm registry"); From 06a8e926b828d3a732f14b09056cb142a1f175ea Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 3 Aug 2026 12:09:19 +0000 Subject: [PATCH 3/3] fix(seer): validate autofix response with existing Zod schema (Sentry CLI-SEER) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miguel Betegón --- packages/cli/src/lib/api/seer.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/lib/api/seer.ts b/packages/cli/src/lib/api/seer.ts index 505ad6a4ad..81ff80ace9 100644 --- a/packages/cli/src/lib/api/seer.ts +++ b/packages/cli/src/lib/api/seer.ts @@ -6,7 +6,11 @@ * which returns blocks instead of steps. */ -import type { AutofixResponse, AutofixState } from "../../types/seer.js"; +import { + AutofixResponseSchema, + type AutofixResponse, + type AutofixState, +} from "../../types/seer.js"; import { resolveOrgRegion } from "../region.js"; @@ -96,6 +100,7 @@ export async function getAutofixState( `/organizations/${orgSlug}/issues/${issueId}/autofix/`, { params: EXPLORER_MODE_PARAMS, + schema: AutofixResponseSchema, } );