This repository was archived by the owner on Aug 30, 2023. It is now read-only.
feat: Upload replay after receiving event from core SDK#83
Merged
Conversation
b878746 to
3e51fa8
Compare
billyvg
commented
Jun 3, 2022
| data: { | ||
| // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode') | ||
| nodeId: targetNode ? record.mirror.getId(targetNode as any) : undefined, | ||
| ...(targetNode ? { nodeId: record.mirror.getId(targetNode as any) } : {}), |
Member
Author
There was a problem hiding this comment.
So we don't send {nodeId: undefined}
| * should flush events immediately | ||
| */ | ||
| addReplayEvent(cb: AddReplayEventCallback) { | ||
| addUpdate(cb?: AddUpdateCallback) { |
Member
Author
There was a problem hiding this comment.
Renamed ReplayEvent to Update
| if (cb() === true) { | ||
| this.finishReplayEvent(); | ||
| if (cb?.() === true) { | ||
| this.flushUpdate(); |
Member
Author
There was a problem hiding this comment.
Renamed finishReplayEvent to flushUpdate
Previously we did not create replay events after receiving new updates from core SDK (e.g. breadcrumbs) -- they only get flushed after an rrweb event. This causes breadcrumbs to be attached to a new session instead of the previous session. e.g. old session -> breadcrumbs -> <idle> (no upload happens) --> new session -> rrweb checkout -> upload (with old breadcrumbs) Fixes #79
3e51fa8 to
88fc354
Compare
Member
Author
|
Gonna merge this as it fixes an annoying bug. |
mydea
pushed a commit
to getsentry/sentry-javascript
that referenced
this pull request
Nov 23, 2022
…ntry-replay#83) Previously we did not create replay events after receiving new updates from core SDK (e.g. breadcrumbs) -- they only get flushed after an rrweb event. This causes breadcrumbs to be attached to a new session instead of the previous session. e.g. old session -> breadcrumbs -> <idle> (no upload happens) --> new session -> rrweb checkout -> upload (with old breadcrumbs) Fixes getsentry/sentry-replay#79
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Previously we did not create replay events after receiving new updates from core SDK (e.g. breadcrumbs) -- they only get flushed after an rrweb event.
This causes breadcrumbs to be attached to a new session instead of the previous session.
e.g. old session -> breadcrumbs -> (no upload happens)
--> new session -> rrweb checkout -> upload (with old breadcrumbs)
Fixes #79