Skip to content
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

RUM-2568: Better handling of event write errors in RUM #1766

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

0xnm
Copy link
Member

@0xnm 0xnm commented Dec 14, 2023

What does this PR do?

This PR improves any error handling in the write pipeline of RUM. Before, if there was any exception thrown inside writing pipeline which wasn't caught, or if write wasn't successful, we didn't notify that event wasn't written (or dropped, in other words). This prevented to decrease pendingXXX counters in RumViewScope, thus making isComplete to evaluate to false in such cases.

This PR also centralizes the place where the notification about write success or failure is sent.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2023

Codecov Report

Merging #1766 (54d41c6) into develop (3947313) will increase coverage by 0.04%.
The diff coverage is 91.93%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1766      +/-   ##
===========================================
+ Coverage    83.64%   83.68%   +0.04%     
===========================================
  Files          465      466       +1     
  Lines        16336    16364      +28     
  Branches      2454     2452       -2     
===========================================
+ Hits         13664    13694      +30     
+ Misses        2018     2017       -1     
+ Partials       654      653       -1     
Files Coverage Δ
...lin/com/datadog/android/rum/internal/RumFeature.kt 93.49% <ø> (+0.63%) ⬆️
...tadog/android/rum/internal/domain/RumDataWriter.kt 100.00% <100.00%> (+7.14%) ⬆️
...ndroid/rum/internal/domain/event/RumEventMapper.kt 100.00% <100.00%> (+4.62%) ⬆️
...kotlin/com/datadog/android/rum/utils/SdkCoreExt.kt 97.44% <97.44%> (ø)
...ndroid/rum/internal/domain/scope/RumActionScope.kt 97.18% <95.52%> (+0.66%) ⬆️
...roid/rum/internal/domain/scope/RumResourceScope.kt 95.17% <94.81%> (+0.49%) ⬆️
.../android/rum/internal/domain/scope/RumViewScope.kt 93.76% <88.97%> (-0.38%) ⬇️

... and 10 files with indirect coverage changes

@0xnm 0xnm force-pushed the nogorodnikov/handle-event-write-errors-in-rum branch from 3501939 to f04c90a Compare December 19, 2023 17:24
@0xnm 0xnm changed the base branch from develop to nogorodnikov/rum-2566/convert-pending-resource-to-pending-error-when-resource-completes-with-an-error December 19, 2023 17:24
@0xnm 0xnm changed the title Better handling of event write errors in RUM RUM-2568: Better handling of event write errors in RUM Dec 19, 2023
Base automatically changed from nogorodnikov/rum-2566/convert-pending-resource-to-pending-error-when-resource-completes-with-an-error to develop December 20, 2023 11:03
@0xnm 0xnm force-pushed the nogorodnikov/handle-event-write-errors-in-rum branch 3 times, most recently from f04c90a to 54d41c6 Compare December 20, 2023 16:05
@0xnm 0xnm marked this pull request as ready for review December 20, 2023 16:07
@0xnm 0xnm requested review from a team as code owners December 20, 2023 16:07
Copy link
Member

@xgouchet xgouchet left a comment

Choose a reason for hiding this comment

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

Niceliy done !

@0xnm 0xnm merged commit 2c6f05b into develop Dec 21, 2023
25 checks passed
@0xnm 0xnm deleted the nogorodnikov/handle-event-write-errors-in-rum branch December 21, 2023 12:59
@xgouchet xgouchet added this to the 2.5.0 milestone Feb 19, 2024
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.

5 participants