dd-sdk-android icon indicating copy to clipboard operation
dd-sdk-android copied to clipboard

RUM-5540: Add stop and start apis for session replay

Open jonathanmos opened this issue 1 year ago • 2 comments

What does this PR do?

• Adds apis to manually start and stop session replay

SessionReplay.stopRecording() SessionReplay.startRecording

• Adds an option to SessionReplayConfiguration so that users can choose to not start recording automatically

SessionReplayConfiguration.. .startRecordingImmediately(false)

  • webviews will not be recorded when SR is stopped
  • has_replay will be sent as 'false' to the backend when SR is stopped
  • startRecordingImmediately will be sent to the backend in the config telemetry

Motivation

Give users the option to stop and start recordings manually.

Additional Notes

Anything else we should know when reviewing?

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)

jonathanmos avatar Aug 07 '24 07:08 jonathanmos

Codecov Report

Attention: Patch coverage is 84.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 70.04%. Comparing base (7257d4d) to head (95d691c). Report is 87 commits behind head on feature/fine-grained-masking.

Files Patch % Lines
...com/datadog/android/sessionreplay/SessionReplay.kt 16.67% 2 Missing and 8 partials :warning:
...oid/sessionreplay/internal/SessionReplayFeature.kt 96.23% 0 Missing and 2 partials :warning:
Additional details and impacted files
@@                       Coverage Diff                        @@
##           feature/fine-grained-masking    #2169      +/-   ##
================================================================
+ Coverage                         70.02%   70.04%   +0.03%     
================================================================
  Files                               726      726              
  Lines                             26987    27033      +46     
  Branches                           4524     4540      +16     
================================================================
+ Hits                              18895    18934      +39     
- Misses                             6816     6818       +2     
- Partials                           1276     1281       +5     
Files Coverage Δ
...ndroid/telemetry/internal/TelemetryEventHandler.kt 84.04% <100.00%> (+1.88%) :arrow_up:
...ndroid/sessionreplay/SessionReplayConfiguration.kt 100.00% <100.00%> (ø)
...oid/sessionreplay/internal/SessionReplayFeature.kt 98.00% <96.23%> (-1.17%) :arrow_down:
...com/datadog/android/sessionreplay/SessionReplay.kt 47.62% <16.67%> (-42.38%) :arrow_down:

... and 26 files with indirect coverage changes

codecov-commenter avatar Aug 07 '24 11:08 codecov-commenter

It would be great to get some additional Android input as well.

Hadn't seen @mariusc83's review :)

mariedm avatar Aug 14 '24 15:08 mariedm

LGTM!

ambushwork avatar Aug 20 '24 07:08 ambushwork