-
-
Notifications
You must be signed in to change notification settings - Fork 465
[SR] Add session replay envelope and events #3214
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
Merged
romtsn
merged 26 commits into
rz/feat/session-replay
from
rz/feat/session-replay-envelopes
Mar 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b1ced85
Add sentry replay envelope and event
romtsn f8419d1
Merge branch 'rz/feat/session-replay-sources' into rz/feat/session-re…
romtsn a63cac1
WIP
romtsn fa72057
Add replay envelopes
romtsn 6cfb511
Remove jsonValue
romtsn 0d031d7
Remove
romtsn 07e6b26
Fix json
romtsn 18af924
Finalize replay envelopes
romtsn 64cedfa
Introduce MapObjectReader
romtsn b8cb924
Add missing test
romtsn 28d341f
Merge branch 'rz/feat/session-replay-envelopes' into rz/feat/session-…
romtsn 1e76fc7
Add test for MapObjectReader
romtsn 13c1971
Add MapObjectWriter change
romtsn a14e090
Merge branch 'rz/feat/session-replay-envelopes' into rz/feat/session-…
romtsn 86baf7f
Add finals
romtsn f1ca9f6
Fix test
romtsn fbbe0d9
Fix test
romtsn 688233f
Merge branch 'rz/feat/session-replay-envelopes' into rz/feat/session-…
romtsn fd63960
Address review
romtsn 93785cc
Add finals and annotations
romtsn 4db19e0
Merge pull request #3215 from getsentry/rz/feat/session-replay-map-ob…
romtsn 62477b4
Remove public captureReplay method
romtsn af42fb3
Fix test
romtsn cd09739
Merge branch 'rz/feat/session-replay-sources' into rz/feat/session-re…
romtsn 4e54c77
api dump
romtsn fb14ecb
Merge branch 'rz/feat/session-replay' into rz/feat/session-replay-env…
romtsn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add sentry replay envelope and event
- Loading branch information
commit b1ced8534d462686bf27ca0ad2867c65c0c6e29f
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| package io.sentry; | ||
|
|
||
| import io.sentry.vendor.gson.stream.JsonToken; | ||
| import java.io.IOException; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import org.jetbrains.annotations.NotNull; | ||
| import org.jetbrains.annotations.Nullable; | ||
|
|
||
| public final class ReplayRecording implements JsonUnknown, JsonSerializable { | ||
|
|
||
| public static final class JsonKeys { | ||
| public static final String SEGMENT_ID = "segment_id"; | ||
| } | ||
|
|
||
| private @Nullable Integer segmentId; | ||
| private @Nullable Map<String, Object> unknown; | ||
|
|
||
| // TODO spec it out, good enough for now | ||
| private @Nullable List<Object> payload; | ||
|
|
||
| @Nullable | ||
| public Integer getSegmentId() { | ||
| return segmentId; | ||
| } | ||
|
|
||
| public void setSegmentId(@Nullable Integer segmentId) { | ||
| this.segmentId = segmentId; | ||
| } | ||
|
|
||
| @Nullable | ||
| public List<Object> getPayload() { | ||
| return payload; | ||
| } | ||
|
|
||
| public void setPayload(@Nullable List<Object> payload) { | ||
| this.payload = payload; | ||
| } | ||
|
|
||
| @Override | ||
| public void serialize(final @NotNull ObjectWriter writer, final @NotNull ILogger logger) | ||
| throws IOException { | ||
| writer.beginObject(); | ||
| if (segmentId != null) { | ||
| writer.name(JsonKeys.SEGMENT_ID).value(segmentId); | ||
| } | ||
|
|
||
| if (unknown != null) { | ||
| for (String key : unknown.keySet()) { | ||
| Object value = unknown.get(key); | ||
| writer.name(key).value(logger, value); | ||
| } | ||
| } | ||
| writer.endObject(); | ||
| } | ||
|
|
||
| @Override | ||
| public @Nullable Map<String, Object> getUnknown() { | ||
| return unknown; | ||
| } | ||
|
|
||
| @Override | ||
| public void setUnknown(@Nullable Map<String, Object> unknown) { | ||
| this.unknown = unknown; | ||
| } | ||
|
|
||
| public static final class Deserializer implements JsonDeserializer<ReplayRecording> { | ||
|
|
||
| @Override | ||
| public @NotNull ReplayRecording deserialize( | ||
| @NotNull JsonObjectReader reader, @NotNull ILogger logger) throws Exception { | ||
|
|
||
| final ReplayRecording replay = new ReplayRecording(); | ||
|
|
||
| @Nullable Map<String, Object> unknown = null; | ||
| @Nullable Integer segmentId = null; | ||
|
|
||
| reader.beginObject(); | ||
| while (reader.peek() == JsonToken.NAME) { | ||
| final String nextName = reader.nextName(); | ||
| switch (nextName) { | ||
| case JsonKeys.SEGMENT_ID: | ||
| segmentId = reader.nextIntegerOrNull(); | ||
| break; | ||
| default: | ||
| if (unknown == null) { | ||
| unknown = new HashMap<>(); | ||
| } | ||
| reader.nextUnknown(logger, unknown, nextName); | ||
| break; | ||
| } | ||
| } | ||
| reader.endObject(); | ||
|
|
||
| replay.setSegmentId(segmentId); | ||
| replay.setUnknown(unknown); | ||
| return replay; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.