Skip to content

fix(android): Backfill exit options when app is unchanged#5762

Draft
romtsn wants to merge 1 commit into
mainfrom
romtsn/fix/validate-app-update-timestamp
Draft

fix(android): Backfill exit options when app is unchanged#5762
romtsn wants to merge 1 commit into
mainfrom
romtsn/fix/validate-app-update-timestamp

Conversation

@romtsn

@romtsn romtsn commented Jul 14, 2026

Copy link
Copy Markdown
Member

📜 Description

Backfill release, environment, distribution, and app version data from the current options when persisted values are unavailable and the app has not been updated since an ANR or native crash.

Treat a missing or invalid package update timestamp conservatively so historical crashes are not attributed to the current app version.

💡 Motivation and Context

Exit events can be missing persisted option values. Current options are safe fallback values only when the installed app version has not changed since the exit; otherwise they can attach metadata from a newer release to an older crash.

💚 How did you test it?

  • ./gradlew ':sentry-android-core:testDebugUnitTest' --tests='*ApplicationExitInfoEventProcessorTest*' --info (42 tests passed)
  • ./gradlew spotlessApply apiDump

📝 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

None.

Use current options when persisted values are missing and the app has not been updated since the exit. Avoid attributing historical crashes to a newer app version.
@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- Backfill exit options when app is unchanged ([#5762](https://github.com/getsentry/sentry-java/pull/5762))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 90b0b05

@sentry

sentry Bot commented Jul 14, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 357.85 ms 438.29 ms 80.44 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4fc476b 280.63 ms 363.04 ms 82.42 ms
6b019b7 343.31 ms 417.23 ms 73.91 ms
83884a0 334.46 ms 400.92 ms 66.46 ms
319f256 315.96 ms 372.96 ms 57.00 ms
e63ad34 297.04 ms 369.90 ms 72.86 ms
d15471f 322.58 ms 396.08 ms 73.50 ms
d364ace 382.77 ms 443.21 ms 60.44 ms
7314dbe 437.83 ms 505.64 ms 67.81 ms
05aa61d 320.22 ms 346.47 ms 26.24 ms
0eaac1e 316.82 ms 357.34 ms 40.52 ms

App size

Revision Plain With Sentry Diff
4fc476b 0 B 0 B 0 B
6b019b7 0 B 0 B 0 B
83884a0 1.58 MiB 2.29 MiB 722.97 KiB
319f256 1.58 MiB 2.19 MiB 619.79 KiB
e63ad34 0 B 0 B 0 B
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
7314dbe 1.58 MiB 2.10 MiB 533.45 KiB
05aa61d 0 B 0 B 0 B
0eaac1e 1.58 MiB 2.19 MiB 619.17 KiB

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.

1 participant