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

feat: Only decorate PageViews with "hasReplay" if the session is not new #1182

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/common/harvest/harvest.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,21 @@
const info = getInfo(this.sharedContext.agentIdentifier)

const ref = this.obfuscator.obfuscateString(cleanURL(getLocation()))
const hr = runtime?.session?.state.sessionReplayMode === 1 && endpoint !== 'jserrors'
let hr = runtime?.session?.state.sessionReplayMode === 1 && endpoint !== 'jserrors'

switch (endpoint) {
case 'jserrors':
hr = false
break

Check warning on line 167 in src/common/harvest/harvest.js

View check run for this annotation

Codecov / codecov/patch

src/common/harvest/harvest.js#L165-L167

Added lines #L165 - L167 were not covered by tests
case 'rum':
// we can not know if SR will be enabled by the rum response in this state, so we can never mark this as true
// there is a potential case where the replay is preloaded setting the replay mode to true before we know the flag values
// if the flag value came back as 0, the data would be dropped and now the pageview has replay flag == true even though we didnt harvest SR
hr = !runtime?.session?.isNew && runtime?.session?.state.sessionReplayMode === 1
break
default:
hr = runtime?.session?.state.sessionReplayMode === 1
}

const qps = [
'a=' + info.applicationID,
Expand Down
Loading