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

RUMM-2562 Correct the way we handle orientation change events in SR #1073

Conversation

mariusc83
Copy link
Collaborator

@mariusc83 mariusc83 commented Oct 6, 2022

What does this PR do?

This PR fixes the way we are handling the orientation change for Session Replay. Previously we were handling this in a separated flow which introduced a new state into the SnapshotProcessor causing problems regarding the new view detection and the order of the records. With this new approach we are handling the OrientationChanged event in the same stack used for handling the screen snapshot and by doing this we eliminate the potential issues resulting from introducing a new state for the SnapshotProcessor.

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)

  • 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)

@mariusc83 mariusc83 self-assigned this Oct 6, 2022
@xgouchet xgouchet added the size-small This PR is small sized label Oct 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2022

Codecov Report

Merging #1073 (87fc25d) into feature/session-replay-vo (ff9a1cf) will decrease coverage by 0.04%.
The diff coverage is 95.24%.

@@                      Coverage Diff                      @@
##           feature/session-replay-vo    #1073      +/-   ##
=============================================================
- Coverage                      82.45%   82.41%   -0.04%     
=============================================================
  Files                            346      347       +1     
  Lines                          11179    11180       +1     
  Branches                        1849     1853       +4     
=============================================================
- Hits                            9217     9213       -4     
- Misses                          1378     1383       +5     
  Partials                         584      584              
Impacted Files Coverage Δ
...tadog/android/sessionreplay/processor/Processor.kt 0.00% <0.00%> (ø)
...droid/sessionreplay/processor/SnapshotProcessor.kt 93.75% <100.00%> (-0.06%) ⬇️
...d/sessionreplay/recorder/RecorderOnDrawListener.kt 86.96% <100.00%> (+0.59%) ⬆️
...id/webview/internal/rum/WebViewRumEventConsumer.kt 76.74% <0.00%> (-9.30%) ⬇️
...ain/java/com/datadog/opentracing/PendingTrace.java 56.03% <0.00%> (-2.59%) ⬇️
.../android/rum/internal/monitor/DatadogRumMonitor.kt 91.91% <0.00%> (ø)
...android/v2/core/internal/DatadogContextProvider.kt 82.81% <0.00%> (ø)
...android/v2/core/internal/net/DataOkHttpUploader.kt 94.52% <0.00%> (ø)
...rsistence/file/batch/PlainBatchFileReaderWriter.kt 89.22% <0.00%> (+0.98%) ⬆️
...android/rum/internal/ndk/DatadogNdkCrashHandler.kt 87.83% <0.00%> (+1.06%) ⬆️

@mariusc83 mariusc83 marked this pull request as ready for review October 6, 2022 12:29
@mariusc83 mariusc83 requested a review from a team as a code owner October 6, 2022 12:29
@@ -159,7 +147,7 @@ internal class SnapshotProcessor(
}
}

private fun isLastFullSnapshotTime(): Boolean {
private fun resolveIsFullSnapshotTime(): Boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe isTimeForFullSnapshort (but yeah , this may not sound better)?

@@ -226,7 +214,7 @@ internal class SnapshotProcessor(
)
}

private fun isNewView(
private fun resolveIsNewView(
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we rename this? imo without resolve it also looks reasonable.

@mariusc83 mariusc83 force-pushed the mconstantin/rumm-2562/correctly-handle-orientation-change-events branch from 404a00e to 87fc25d Compare October 6, 2022 13:54
@mariusc83 mariusc83 merged commit e6b3c45 into feature/session-replay-vo Oct 6, 2022
@mariusc83 mariusc83 deleted the mconstantin/rumm-2562/correctly-handle-orientation-change-events branch October 6, 2022 14:52
@xgouchet xgouchet added this to the 1.17.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-small This PR is small sized
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants