Skip to content

fix(okhttp): Finalize OkHttpEvent even if no active span #4469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 4, 2025

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Jun 4, 2025

📜 Description

  • When SentryOkHttpInterceptor is used in conjunction with SentryOkHttpEventListener and there's no active span we were not properly finalizing OkHttpEvent. And edge-case could happen when OkHttp is used directly and the response body is not closed, resulting in OkHttpEvent never being finalized.

💡 Motivation and Context

Found in our sales-demo app

💚 How did you test it?

Automated

📝 Checklist

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

🔮 Next steps

Copy link
Contributor

github-actions bot commented Jun 4, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 466.69 ms 498.33 ms 31.65 ms
Size 1.58 MiB 2.08 MiB 510.93 KiB

Previous results on branch: rz/fix/okhttp-event-finalization

Startup times

Revision Plain With Sentry Diff
9bea0ae 413.27 ms 468.20 ms 54.92 ms

App size

Revision Plain With Sentry Diff
9bea0ae 1.58 MiB 2.08 MiB 510.92 KiB

@romtsn romtsn enabled auto-merge (squash) June 4, 2025 09:57
@romtsn romtsn merged commit 25b5638 into main Jun 4, 2025
34 checks passed
@romtsn romtsn deleted the rz/fix/okhttp-event-finalization branch June 4, 2025 10:03
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy