Repository navigation
fix: Keep handling LinkageError where the SDK expects it (JAVA-552) - #6666
Draft
runningcode wants to merge 5 commits into
Draft
runningcode wants to merge 5 commits into
runningcode wants to merge 5 commits into
Conversation
ExceptionUtils.rethrowIfFatal rethrows LinkageError. At these sites a LinkageError is the expected failure: a native library that failed to load, a missing optional dependency, or a mismatched Compose or androidx version. Each one is narrowed to the types the guarded code throws, or catches LinkageError before a broad catch that calls rethrowIfFatal. The event processor loops in SentryClient handle a LinkageError like any other processor failure. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 of 9 tasks
This was referenced Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 18, 2026
📲 Install BuildsAndroid
|
Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
User and hybrid callbacks, the logback encoder, and the Apollo, Servlet and Spring calls in the integrations can throw a LinkageError that isn't fatal there, because an optional module is missing or has an incompatible version. These sites now treat it like any other exception and call ExceptionUtils.rethrowIfFatal for the rest. The options configuration in Sentry.init and SentryAndroid.init continues with the options applied so far. Scopes.close logs a LinkageError from a replaceable component and goes on with the remaining shutdown steps, while fatal errors propagate. AppState catches failures of the first ON_START dispatch again, so a throwing app state listener can't crash the main looper. The callback Javadoc moves here with the sites it describes. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
runningcode
added a commit
that referenced
this pull request
Nov 19, 2026
Sites whose try wraps user or hybrid callbacks, or code from compileOnly modules, can see a LinkageError that is not fatal there, so they move to #6666, which handles it at the call site. The screenshot and replay capture sites move to the bitmap OOM PR, and the callback Javadoc moves with the sites it describes. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 of 9 tasks
3 of 9 tasks
This branch has not been 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.
📜 Description
At these
catch (Throwable)sites aLinkageErroris an expected failure, not a fatal one: a native library that didn't load, a missing optional dependency, or a mismatched Compose, androidx or framework version. Each site now handles theLinkageErroritself, narrowing the catch where it can, and otherwise callsExceptionUtils.rethrowIfFatalfor the rest. The user-facing callbacks also get Javadoc saying what happens when they throw.Exceptions:
LinkageErrorshares the catch with other exceptions through aninstanceofcheck beforerethrowIfFatal, so the failure handling isn't duplicated.Scopes.closecloses each replaceable component in its ownLinkageErrorcatch, so one broken component doesn't stop the rest of the shutdown or a re-init. Its outer catch also getsrethrowIfFatal.WindowManagerSpy's reflection is narrowed, but the root view swap gets its own broad catch withrethrowIfFatal, because the swap runs replay's root view listeners.💡 Motivation and Context
This is part of the
catch (Throwable)audit. It's independent of the other JAVA-552 PRs, so it can merge in any order.💚 How did you test it?
No new tests, only the existing ones.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog
🤖 Generated with Claude Code