Skip to content

feat(core): Unhandled Sessions - #5915

Open
buenaflor wants to merge 1 commit into
mainfrom
feat/unhandled-sessions
Open

feat(core): Unhandled Sessions#5915
buenaflor wants to merge 1 commit into
mainfrom
feat/unhandled-sessions

Conversation

@buenaflor

@buenaflor buenaflor commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

PR Stack (Unhandled Sessions)


Collection PR for the Unhandled Sessions stack. Squash-merge this once all stack PRs are merged.

📜 Description

Teaches the SDK the session protocol's unhandled status: an unhandled error that did not terminate the process. Adds an internal capture entry point so hybrid runtimes such as Flutter can report those exceptions without ending the session as crashed.

Split out of #5795 into reviewable pieces:

  1. feat(core): [Unhandled Sessions 1] Add Unhandled session state and non-terminating error flag #5919 — the Session model: State.Unhandled and the nonTerminatingUnhandledError flag.
  2. fix(core): [Unhandled Sessions 2] Don't let a queued SessionStart overwrite a newer session #5920EnvelopeCache: session-id-aware session file writes, so a snapshot cannot be clobbered by a delayed start or end.
  3. feat(android): [Unhandled Sessions 3] Add internal non-terminating envelope capture #5921InternalSentrySdk.captureEnvelopeNonTerminating plus the changelog entry.
  4. feat(android): [Unhandled Sessions 4] Add session update for dropped hybrid errors #5990InternalSentrySdk.updateSessionForDroppedEventNonTerminating for errors dropped by sampling.

💡 Motivation and Context

Flutter forwards handled=false events through the terminating hybrid capture path. That marks the session crashed and may start a replacement session even though the Flutter process keeps running, incorrectly lowering crash-free session rates.

💚 How did you test it?

See the individual stack PRs; each carries its own tests.

#skip-changelog

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 2d1a67a

@sentry

sentry Bot commented Aug 10, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 339.37 ms 422.63 ms 83.26 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6b019b7 343.31 ms 417.23 ms 73.91 ms
d15471f 286.65 ms 314.68 ms 28.03 ms
d217708 409.83 ms 474.72 ms 64.89 ms
d500866 326.13 ms 378.70 ms 52.58 ms
fcec2f2 314.96 ms 373.66 ms 58.70 ms
d501a7e 314.55 ms 343.34 ms 28.79 ms
7414e9b 322.49 ms 378.88 ms 56.39 ms
fcec2f2 357.47 ms 447.32 ms 89.85 ms
a416a65 316.52 ms 359.67 ms 43.15 ms
983e0f0 350.64 ms 386.44 ms 35.79 ms

App size

Revision Plain With Sentry Diff
6b019b7 0 B 0 B 0 B
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
d500866 0 B 0 B 0 B
fcec2f2 1.58 MiB 2.12 MiB 551.50 KiB
d501a7e 0 B 0 B 0 B
7414e9b 0 B 0 B 0 B
fcec2f2 1.58 MiB 2.12 MiB 551.50 KiB
a416a65 1.58 MiB 2.12 MiB 555.26 KiB
983e0f0 0 B 0 B 0 B

@buenaflor buenaflor closed this Aug 24, 2026
@buenaflor buenaflor reopened this Aug 24, 2026
@buenaflor
buenaflor marked this pull request as ready for review August 24, 2026 10:32
Copilot AI lite review requested due to automatic review settings August 24, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…get (#5828)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io>
@buenaflor
buenaflor force-pushed the feat/unhandled-sessions branch from d52eb4a to 2d1a67a Compare August 25, 2026 12:33
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.

3 participants