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

fix: Disable the string reduction code until we can battle test it more. #851

Merged
merged 6 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/extensions/replay/sessionrecording-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export function ensureMaxMessageSize(data: eventWithTime): { event: eventWithTim
// Note: with compression, this limit may be able to be increased
// but we're assuming most of the size is from a data uri which
// is unlikely to be compressed further

if (stringifiedData.length > MAX_MESSAGE_SIZE) {
// Regex that matches the pattern for a dataURI with the shape 'data:{mime type};{encoding},{data}'. It:
// 1) Checks if the pattern starts with 'data:' (potentially, not at the start of the string)
Expand Down
5 changes: 3 additions & 2 deletions src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
SESSION_RECORDING_RECORDER_VERSION_SERVER_SIDE,
} from '../../constants'
import {
ensureMaxMessageSize,
FULL_SNAPSHOT_EVENT_TYPE,
INCREMENTAL_SNAPSHOT_EVENT_TYPE,
META_EVENT_TYPE,
Expand Down Expand Up @@ -530,7 +529,9 @@ export class SessionRecording {
return
}

const { event, size } = ensureMaxMessageSize(truncateLargeConsoleLogs(throttledEvent))
// TODO: Re-add ensureMaxMessageSize once we are confident in it
const event = truncateLargeConsoleLogs(throttledEvent)
const size = JSON.stringify(event).length

const properties = {
$snapshot_bytes: size,
Expand Down
Loading