Skip to content

fix: Stop swallowing errors in three places the Throwable audit found (JAVA-552) - #6670

Draft
runningcode wants to merge 3 commits into
9.x.xfrom
no/java-552-audit-fixes
Draft

runningcode wants to merge 3 commits into
9.x.xfrom
no/java-552-audit-fixes

Conversation

@runningcode

@runningcode runningcode commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Fix three bugs that the catch (Throwable) audit found:

  • QueueFile deleted its file when reading it ran out of memory, as if the file were corrupt. It now resets the file only for the IndexOutOfBoundsException that a corrupt file causes, so the offline cache keeps its queue.
  • Installation wrapped an OutOfMemoryError in a RuntimeException, which its callers catch. It now wraps only the IOException from reading or writing the installation file.
  • The Ktor client integration swallowed coroutine cancellation while reading the response body for a failed-request event. It now rethrows CancellationException, and calls ExceptionUtils.rethrowIfFatal for anything else the HTTP engine throws.

That's 3 sites.

Mixed sites

💡 Motivation and Context

This is part of the catch (Throwable) audit. It replaces the three bug fixes in #6562.

This PR is independent of its siblings and they can merge in any order:

💚 How did you test it?

  • The existing unit tests of sentry, sentry-android-core and sentry-ktor-client.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The changelog entry for the whole set is in #6665.

#skip-changelog

🤖 Generated with Claude Code

QueueFile deleted its file when reading it ran out of memory, as if the file were corrupt. It now resets the file only for the IndexOutOfBoundsException that a corrupt file causes.

Installation wrapped an OutOfMemoryError in a RuntimeException. It now wraps only the IOException from reading or writing the installation file.

The Ktor client integration swallowed coroutine cancellation while reading the response body for a failed-request event. It now rethrows CancellationException and fatal errors.

Refs #5513

Refs JAVA-552

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 18, 2026

Copy link
Copy Markdown

JAVA-552

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sentry

sentry Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.64.0 (1) release

⚙️ sentry-android Build Distribution Settings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 18, 2026

This branch has not been deployed

No deployments
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