RUM-7664: Add try-catch in drawOnCanvas in order to catch exceptions from draw(canvas) method#2549
Merged
aleksandr-gringauz merged 1 commit intoMar 18, 2025
Conversation
aleksandr-gringauz
force-pushed
the
gringauz/rum-7664/try-fix-draw-uncaughtexception-in-session-replay-2
branch
from
March 17, 2025 13:17
e42ae12 to
9056cfa
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2549 +/- ##
===========================================
- Coverage 70.04% 70.01% -0.03%
===========================================
Files 797 798 +1
Lines 30027 30036 +9
Branches 5027 5028 +1
===========================================
- Hits 21031 21029 -2
- Misses 7595 7605 +10
- Partials 1401 1402 +1
🚀 New features to boost your workflow:
|
aleksandr-gringauz
marked this pull request as ready for review
March 17, 2025 14:15
ambushwork
reviewed
Mar 17, 2025
| internalLogger.log( | ||
| InternalLogger.Level.ERROR, | ||
| listOf(InternalLogger.Target.TELEMETRY), | ||
| { DRAWABLE_DRAW_FINISHED_WITH_ANDROID_RUNTIME_EXCEPTION }, |
Member
There was a problem hiding this comment.
Will it be interesting to log the drawable type for further investigation?
jonathanmos
previously approved these changes
Mar 17, 2025
ambushwork
previously approved these changes
Mar 17, 2025
0xnm
previously approved these changes
Mar 18, 2025
| } catch (exception: AndroidRuntimeException) { | ||
| internalLogger.log( | ||
| InternalLogger.Level.ERROR, | ||
| listOf(InternalLogger.Target.TELEMETRY), |
Member
There was a problem hiding this comment.
very nit: there is an overload which takes a single target
Suggested change
| listOf(InternalLogger.Target.TELEMETRY), | |
| InternalLogger.Target.TELEMETRY, |
jonathanmos
previously approved these changes
Mar 18, 2025
aleksandr-gringauz
dismissed stale reviews from jonathanmos and 0xnm
via
March 18, 2025 08:55
73808cd
0xnm
approved these changes
Mar 18, 2025
aleksandr-gringauz
force-pushed
the
gringauz/rum-7664/try-fix-draw-uncaughtexception-in-session-replay-2
branch
from
March 18, 2025 09:09
73808cd to
4167754
Compare
…from draw(canvas) method
aleksandr-gringauz
force-pushed
the
gringauz/rum-7664/try-fix-draw-uncaughtexception-in-session-replay-2
branch
from
March 18, 2025 10:21
4167754 to
97a2382
Compare
aleksandr-gringauz
deleted the
gringauz/rum-7664/try-fix-draw-uncaughtexception-in-session-replay-2
branch
March 18, 2025 13:18
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.
What does this PR do?
Sometimes
Drawable.draw(canvas)can throw anAndroidRuntimeExceptionwhen called not on the main thread. We catch this exception.[internal]
For full investigation see the jira ticket https://datadoghq.atlassian.net/browse/RUM-7664?focusedCommentId=2227218
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)