Skip to content

Fix a bug where disabling the sdk might cause a background exception#2226

Merged
priettt merged 1 commit intomainfrom
priettt/disableFix
Jun 5, 2025
Merged

Fix a bug where disabling the sdk might cause a background exception#2226
priettt merged 1 commit intomainfrom
priettt/disableFix

Conversation

@priettt
Copy link
Copy Markdown
Contributor

@priettt priettt commented Jun 4, 2025

Goal

runCatching doesn't handle exceptions happening on another thread. This PR fixes that issue.

@priettt priettt requested a review from a team as a code owner June 4, 2025 20:11
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 4, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 4, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.58%. Comparing base (8b2c7ee) to head (5cf3065).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../java/io/embrace/android/embracesdk/EmbraceImpl.kt 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2226      +/-   ##
==========================================
- Coverage   85.62%   85.58%   -0.04%     
==========================================
  Files         467      467              
  Lines       10398    10400       +2     
  Branches     1531     1532       +1     
==========================================
- Hits         8903     8901       -2     
- Misses        836      838       +2     
- Partials      659      661       +2     
Files with missing lines Coverage Δ
.../java/io/embrace/android/embracesdk/EmbraceImpl.kt 80.92% <66.66%> (-1.75%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

This should fix this issue. That said, I would move this entire block after stop(). If the SDK isn't started when this is called, we shouldn't trigger a delete, which requires the SDK to have been started.

Either make the purge not require the SDK to have started before or don't invoke it.

@priettt priettt force-pushed the priettt/disableFix branch from f534092 to 5cf3065 Compare June 4, 2025 20:41
@priettt priettt merged commit 9058028 into main Jun 5, 2025
11 checks passed
@priettt priettt deleted the priettt/disableFix branch June 5, 2025 16:12
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