Repository navigation
ref(core): Add InternalServices for what the SDK owns - #6830
Open
runningcode wants to merge 4 commits into
Open
runningcode wants to merge 4 commits into
runningcode wants to merge 4 commits into
Conversation
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:
|
Contributor
PR risk: mediumFor commit Main concerns: reach, public contract, host performance. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
📲 Install BuildsAndroid
|
4 of 9 tasks
SentryRuntime holds the collaborators the SDK owns rather than the customer (serializer, executor, envelope disk cache). Sentry.init builds it once, through LegacyOptionsBridge, from what is on SentryOptions and copies it back, so existing readers see the same instances. Nothing reads from it yet; follow-up PRs move the readers to constructor injection before the SentryOptions accessors get deprecated. Part of JAVA-817 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/sentryruntime-foundation
branch
from
December 3, 2026 12:24
4b9b580 to
a993645
Compare
"Collaborators" read as jargon. "Internal services" says what they are: the objects the SDK creates and manages for itself, as opposed to what the customer configures on SentryOptions. Part of JAVA-817 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
io.sentry.protocol.SentryRuntime already exists as the event's runtime context, so the API listed two public SentryRuntime classes. InternalServices says what the class holds, in the words its docs already use. Part of JAVA-817 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Android the executor already exists, and integrations start using it, before the hybrid SDK's callback runs. An executor set on the InternalServices builder from that callback would replace it without closing it. Until 9.0, hybrid SDKs set their executor on SentryOptions, which the bridge already honors. Part of JAVA-817 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
marked this pull request as ready for review
December 3, 2026 16:23
runningcode
requested review from
0xadam-brown and
markushi
and removed request for
a team
December 3, 2026 16:24
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
Adds
io.sentry.internal.InternalServices, an immutable holder for the SDK's internal services: the objects the SDK creates and manages for itself rather than the customer, namely the serializer, the executor and the envelope disk cache. It is built once perSentry.init. Nothing reads from it yet; follow-up PRs move each internal service's readers to constructor injection.LegacyOptionsBridgebuildsInternalServicesfrom what is onSentryOptionsand copies it back, so code that still reads the options sees the same instances.InternalIntegrationletsSentry.inithandInternalServicesto SDK integrations.Sentry.initandSentryAndroid.inittake anInternalServices.Builderthrough new internal overloads. Hybrid SDKs getInternalSentrySdk.init(context, logger, (options, services) -> …)andInternalSentrySdk.getInternalServices(). A disk cache a hybrid SDK sets on the builder takes effect with ref(core): Inject the envelope disk cache from InternalServices #6833. Until then, the platform's cache on the options wins. Hybrid SDKs keep setting the executor on the options until 9.0, because on Android it's already in use before their callback runs.No behavior change:
InternalServicesis built whereinitused to replace a closed executor, and it reuses the disk cacheinitConfigurationsalready created.💡 Motivation and Context
Part of JAVA-817. Customers should only configure
SentryOptions. Moving the SDK's internals off it lets 9.0 remove them from the public API.💚 How did you test it?
InternalServicesTest, plus the existingsentryandsentry-android-coreunit tests.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Separate PRs move executor shutdown, the integrations, the disk cache and the init-time executor users onto
InternalServices. A last PR deprecates theSentryOptionsaccessors.🤖 Generated with Claude Code
#skip-changelog