Skip to content

chore: Remove unused SentrySuccessfulResponseBody - #5899

Merged
jamescrosswell merged 1 commit into
mainfrom
chore/remove-unused-sentry-successful-response-body
Nov 9, 2026
Merged

jamescrosswell merged 1 commit into
mainfrom
chore/remove-unused-sentry-successful-response-body

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Removes src/Sentry/Internal/Http/SentrySuccessfulResponseBody.cs, an internal, #if DEBUG-only DTO for the {"id": "..."} body that Sentry returns on a successful store request (23 lines). Nothing references it.

When it was added: df6a20f ("Composer assembles the SDK"), part of #9 (Implementing the new unified SDK API), merged 2018-06-10. HttpTransport used it in a #if DEBUG block to deserialize the response body and Debug.Assert that the returned id matched the event id it had sent.

When it became irrelevant, and why: #544 (Envelopes, merged 2020-10-15, commit 5dada5b) switched HttpTransport from sending single events to sending envelopes. It replaced that DEBUG-only assert with a "Envelope {0} successfully received by Sentry." debug log and deleted the only call to DeserializeObject<SentrySuccessfulResponseBody>. The class file wasn't part of that change, so it stayed behind. Since then it has only been touched by cosmetic passes: #562 (reference URL), #509 (nullable annotations, before #544) and #2063 (misc cleanup).

Evidence it's unused:

  • git log -S SentrySuccessfulResponseBody across the full history returns only df6a20f (added the type and its caller) and 5dada5b (removed the caller).
  • Searching the repo outside modules/ for SentrySuccessfulResponseBody finds only the deleted file. The test helper SentryResponses.SentryOkResponseBody is an unrelated string constant.
  • The class carries #pragma warning disable S1144 ("Unused private types or members should be removed") and S3459 to silence the analyzers that flag it.

Why it's safe: the type is internal and only compiles in Debug, so it's not in the shipped Release assemblies and not in the API approval snapshots. Nothing constructs it, so behavior doesn't change. No target framework or package dependency changes.

Checks:

  • dotnet build src/Sentry/Sentry.csproj passes in both Debug (where the file used to compile) and Release for net8.0, net9.0, net10.0, netstandard2.1, netstandard2.0 and net462, with 0 warnings.
  • Sentry.Tests on net10.0: 2,800 passed, 0 failed, 5 skipped. No snapshot changes.
  • Not run locally: Android, iOS and Mac Catalyst targets (no mobile workloads in the sandbox), and tests on net8.0, net9.0 and net462. The sandbox didn't have the pinned workload version, so workloadVersion was dropped from global.json for the local build only. That change isn't committed.

#skip-changelog

via automation sched_2fb5d12bd3a78841d7d2559c56e8141d · Run ID sched_2fb5d12bd3a78841d7d2559c56e8141d:1794207600000.

--

View Session [Sentry]

Its only caller, a DEBUG-only response id assert in HttpTransport, was
removed by #544 (Envelopes) in 2020.
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.78%. Comparing base (2b68abe) to head (a5231b0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5899      +/-   ##
==========================================
+ Coverage   76.77%   76.78%   +0.01%     
==========================================
  Files         532      532              
  Lines       19826    19826              
  Branches     3909     3909              
==========================================
+ Hits        15222    15224       +2     
+ Misses       3718     3717       -1     
+ Partials      886      885       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell marked this pull request as ready for review November 9, 2026 20:31
@jamescrosswell
jamescrosswell merged commit d30060f into main Nov 9, 2026
59 checks passed
@jamescrosswell
jamescrosswell deleted the chore/remove-unused-sentry-successful-response-body branch November 9, 2026 20:31
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant