DataDog / dd-sdk-android

Datadog SDK for Android (Compatible with Kotlin and Java)
Apache License 2.0
146 stars 59 forks source link

RUM-4821 unregister vital listeners when view is stopped #2009

Closed xgouchet closed 4 months ago

xgouchet commented 4 months ago

What does this PR do?

This fixes a bug where we forgot to unregister the vital listeners. This lead to two issues:

Fixes #2008

codecov-commenter commented 4 months ago

Codecov Report

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

Project coverage is 83.69%. Comparing base (cff8b54) to head (6567e67). Report is 2 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #2009 +/- ## =========================================== - Coverage 83.71% 83.69% -0.01% =========================================== Files 488 488 Lines 17736 17772 +36 Branches 2659 2667 +8 =========================================== + Hits 14846 14874 +28 + Misses 2177 2172 -5 - Partials 713 726 +13 ``` | [Files](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2009?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [...ndroid/rum/internal/domain/scope/RumActionScope.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2009?src=pr&el=tree&filepath=features%2Fdd-sdk-android-rum%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Frum%2Finternal%2Fdomain%2Fscope%2FRumActionScope.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZmVhdHVyZXMvZGQtc2RrLWFuZHJvaWQtcnVtL3NyYy9tYWluL2tvdGxpbi9jb20vZGF0YWRvZy9hbmRyb2lkL3J1bS9pbnRlcm5hbC9kb21haW4vc2NvcGUvUnVtQWN0aW9uU2NvcGUua3Q=) | `97.77% <100.00%> (+0.61%)` | :arrow_up: | | [.../android/rum/internal/domain/scope/RumViewScope.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2009?src=pr&el=tree&filepath=features%2Fdd-sdk-android-rum%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Frum%2Finternal%2Fdomain%2Fscope%2FRumViewScope.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZmVhdHVyZXMvZGQtc2RrLWFuZHJvaWQtcnVtL3NyYy9tYWluL2tvdGxpbi9jb20vZGF0YWRvZy9hbmRyb2lkL3J1bS9pbnRlcm5hbC9kb21haW4vc2NvcGUvUnVtVmlld1Njb3BlLmt0) | `94.81% <94.44%> (+0.46%)` | :arrow_up: | ... and [26 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2009/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)