RUMM-2775 Add Session Replay Uploader#1063
Conversation
| return if (body == null || originalRequest.header(HEADER_ENCODING) != null) { | ||
| return if (body == null || | ||
| originalRequest.header(HEADER_ENCODING) != null || | ||
| body is MultipartBody |
There was a problem hiding this comment.
we skip Gzip compression, because body is already Gzipped in this case? shouldn't we then add a header (encoding?) saying that it is gzipped? because generally speaking MultipartBody (not from SR) can be in plain as well.
There was a problem hiding this comment.
yeah I was actually thinking to this but then I will have to change a bit more this logic to go through all the multipart bodies. Let me see if I can do something about it.
| internal class BatchesToSegmentsMapper { | ||
|
|
||
| fun map(batchData: List<ByteArray>): List<Pair<MobileSegment, JsonObject>> { | ||
| return groupBatchDataIntoSegments(batchData) |
There was a problem hiding this comment.
minor: probably can just inline groupBatchDataIntoSegments here. This method does nothing else than calling another method.
| BytesCompressor.CHECKSUM_FLAG_SIZE_IN_BYTES | ||
| ) | ||
| ) | ||
| decompressor.finished() |
There was a problem hiding this comment.
why do we need this call? per documentation it seems it doesn't modify anything, just returns the state.
Codecov Report
@@ Coverage Diff @@
## feature/session-replay-vo #1063 +/- ##
=============================================================
- Coverage 83.36% 82.35% -1.01%
=============================================================
Files 343 346 +3
Lines 10791 11042 +251
Branches 1792 1814 +22
=============================================================
+ Hits 8995 9093 +98
- Misses 1239 1385 +146
- Partials 557 564 +7
|
7b3ed5b to
294ab95
Compare
0xnm
left a comment
There was a problem hiding this comment.
I've added some new comments (plus there are some comments from the previous round), but overall seems good! Just few final edits are needed.
| /** Maps a batch to a List<Pair<MobileSegment, SerializedMobileSegment>> for uploading. | ||
| * This class is meant for internal usage. | ||
| */ |
There was a problem hiding this comment.
A bit of formatting
| /** Maps a batch to a List<Pair<MobileSegment, SerializedMobileSegment>> for uploading. | |
| * This class is meant for internal usage. | |
| */ | |
| /** | |
| * Maps a batch to a List<Pair<MobileSegment, SerializedMobileSegment>> for uploading. | |
| * This class is meant for internal usage. | |
| */ |
| /** Compresses the payload data using the ZIP compression algorithm. | ||
| * This class is meant for internal usage. | ||
| */ |
There was a problem hiding this comment.
| /** Compresses the payload data using the ZIP compression algorithm. | |
| * This class is meant for internal usage. | |
| */ | |
| /** | |
| * Compresses the payload data using the ZIP compression algorithm. | |
| * This class is meant for internal usage. | |
| */ |
294ab95 to
477ff88
Compare
477ff88 to
e0418fe
Compare
What does this PR do?
In this PR we are adding the logic for reading the Session Replay batches, group them into Segments by RUM context and send them as separated payloads.
Note for reviewers: We are using an intermediary hack for now to use the new SDK V2
RequestFactory->SessionReplayOkHttpUploader. This class and the logic inside will be eventually migrated in theSessionReplayRequestFactoryonce thebatch to multiple requestsfeature will be available in SDK v2.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)