Skip to content

ref: Remove unused code - #6826

Merged
runningcode merged 1 commit into
mainfrom
ref/remove-unused-code-2026-12
Dec 1, 2026
Merged

runningcode merged 1 commit into
mainfrom
ref/remove-unused-code-2026-12

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Removes code that nothing calls anymore. Every removed member is @ApiStatus.Internal or not public, so there is no change to the public API. sentry.api only loses Internal entries.

Removal Module Why it is unused
NoOpLoggerBatchProcessor sentry Internal. The last caller was removed in #6184.
NoOpMetricsBatchProcessor sentry Internal. The last caller was removed in #6184.
SentryOptions.containsIgnoredExceptionForType sentry Package-private. The last caller was removed in #4083, and no test uses it.
MemoryLimiterIntegration.MEMORY_LIMITER_DESCRIPTION sentry-android-core Package-private. Since #6174, production code matches only MEMORY_LIMITER_DESCRIPTION_PREFIX. Only MemoryLimiterIntegrationTest and ApplicationExitInfoCrossIntegrationTest read the constant, as fixture data, so the value now lives in those tests.
DebugOverlayDrawable.padding sentry-android-replay Private and never read since the class was added in #4357.

None of these are referenced from any Java, Kotlin, or Groovy source, XML, ProGuard or consumer rules, META-INF/services, Gradle files, sentry-samples, or sentry-android-integration-tests. Nothing reaches them through reflection, ServiceLoader, or the manifest either.

Left in place on purpose:

  • HintUtils.runIfDoesNotHaveType with HintUtils.SentryNullableConsumer, and SentryExecutorService.isSentryExecutorThread() with its marker thread subclass: no callers since Discard envelopes on 4xx and 5xx response #4950 and perf(core): Batch and coalesce scope-persistence disk writes #5791. They are kept because ref(core): [Hybrid SDK API 1] Mark the non-customer API that hybrid SDKs use #6785 marks both classes @HybridSdkApi, so they should wait for that PR to land.
  • NoOpSubscriptionHandler (graphql): only tests use it, but the GraphQL integration docs show it to users.
  • ScopesUtil.printScopesChain: no callers, but it looks like a deliberate tool for debugging by hand.
  • AndroidCurrentDateProvider: unused, but deprecated and waiting for removal in a major version.
  • SentryReplayOptions.setTrackConfiguration: no callers in this repo, but its Javadoc describes manual use, likely by hybrid SDKs.
  • @TestOnly accessors whose only callers are tests, such as the ActivityLifecycleIntegration span maps, SentryTracer timer futures, and AppStartMetrics setters: these are test seams that assert on real behavior. AppStartMetrics is also used by hybrid SDKs.
  • Unused private fields in vendored io.sentry.util.Random: vendored code, and the class is Serializable.

💡 Motivation and Context

Dead Internal code makes the API dump and the codebase bigger with no benefit.

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

#skip-changelog

via automation sched_fe84dfba72a04a9279fe3ffbedff96f0 · Run ID sched_fe84dfba72a04a9279fe3ffbedff96f0:1796115600000.

--

View Session [Sentry]

Remove Internal and package-private code that nothing in the SDK calls
anymore, and move a production constant that only tests read into the tests.
@github-actions github-actions Bot added the risk: high PR risk score: high label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

PR risk: high

For commit dafb571.

Main concerns: public contract, reach.

Rules that block low also fired:

  • R4: a public API record changed: sentry/api/sentry.api

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Dec 1, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode marked this pull request as ready for review December 1, 2026 15:20
@runningcode
runningcode requested a review from a team as a code owner December 1, 2026 15:20
@runningcode
runningcode requested review from 0xadam-brown and romtsn and removed request for a team December 1, 2026 15:20
@github-actions github-actions Bot added risk: high PR risk score: high and removed risk: high PR risk score: high labels Dec 1, 2026
@runningcode
runningcode merged commit b98cbdd into main Dec 1, 2026
54 checks passed
@runningcode
runningcode deleted the ref/remove-unused-code-2026-12 branch December 1, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants