Skip to content

fix(android): Skip dist fallback when release has no version code - #6450

Open
sentry-junior[bot] wants to merge 2 commits into
mainfrom
fix/anr-dist-without-version-code
Open

sentry-junior[bot] wants to merge 2 commits into
mainfrom
fix/anr-dist-without-version-code

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

When options.dist is unset, ApplicationExitInfoEventProcessor derives dist from the version code after the + in the release (package@versionName+versionCode). This change only applies that fallback when the release actually contains a +. Otherwise dist stays empty, which matches how MainEventProcessor handles regular events.

💡 Motivation and Context

For a release without a +, such as io.sentry.samples@1.2, indexOf('+') returned -1, so substring(0) turned the entire release string into dist. Relay only allows a-zA-Z0-9_.- in dist, so it threw the value away with invalid character '@'.

The try/catch (Throwable) is gone because substring can no longer throw on this path.

setAppVersionAndBuild still leaves app_version/app_build empty for releases without a +. That's the existing behavior covered by if release is in wrong format, does not crash and leaves app version and build empty, so I didn't change it here.

💚 How did you test it?

I added unit tests for both ways the release can be resolved (persisted options and current options) with a release that has no version code. They run in CI.

📝 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.

via gene.wright.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 2, 2026 18:30
ApplicationExitInfoEventProcessor derived dist from the text after '+' in the release. Without a '+', indexOf returned -1 and the whole release became dist, which Relay rejects for characters like '@'.

Co-Authored-By: Gene Wright <gene.wright@sentry.io>
Co-Authored-By: Gene Wright <gene.wright@sentry.io>
@sentry

sentry Bot commented Nov 2, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 2, 2026 19:42
@sentry-junior
sentry-junior Bot requested review from a team and adinauer as code owners November 2, 2026 19:42
@sentry-junior
sentry-junior Bot requested review from markushi and runningcode and removed request for a team November 2, 2026 19:42

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ANR events get invalid dist when release has no +

0 participants