Skip to content

feat: Support browser Replay in renderers#618

Merged
timfish merged 2 commits intogetsentry:masterfrom
timfish:feat/replay
Jan 11, 2023
Merged

feat: Support browser Replay in renderers#618
timfish merged 2 commits intogetsentry:masterfrom
timfish:feat/replay

Conversation

@timfish
Copy link
Copy Markdown
Collaborator

@timfish timfish commented Jan 11, 2023

Closes #606

This PR:

  • Updates the JavaScript SDKs to 7.30.0 for the PRs/changes listed in the above linked issue
  • Adds normalizeUrlsInReplayEnvelope and calls it with envelopes that are passed through the main process
  • Adds a test that checks Replay running in the renderer results in a Replay event
    • The test server and test event normalisation required a few changes

This PR initially failed for lint errors in unchanged files. I ended up needing to:

  • Update eslint version to match the JavaScript monorepo
  • Fixed or ignored the new errors

@timfish timfish marked this pull request as ready for review January 11, 2023 01:20
chunks.push(buf.slice(0, i + 1).toString());
buf = buf.slice(i + 1);
chunks.push(buf.subarray(0, i + 1).toString());
buf = buf.subarray(i + 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we made this change for performance reasons?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to fix a lint warning as slice is now deprecated.

It also happens to be better for perf. as there's no new allocation!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to fix a lint warning as slice is now deprecated.

TIL!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL that Buffer.prototype.slice() is not compatible with the Uint8Array.prototype.slice(), which is a superclass of Buffer.

@timfish timfish merged commit 207b211 into getsentry:master Jan 11, 2023
@timfish timfish deleted the feat/replay branch January 11, 2023 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Session Replay

2 participants