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

Return early for child same origin frames #1295

Merged
merged 1 commit into from
May 29, 2024

Conversation

colingm
Copy link
Contributor

@colingm colingm commented Aug 30, 2023

If we have cross origin record turned on but we are in a child frame that has the same origin as its parent we end up in sort of an inefficient state. We will start the recording, record mutations, but then never actually emit them anywhere since inEmittingFrame and passEmitsToParent are both false. This is a waste of resources and we might as well just never start the recording.

Brought this up in slack: https://rrweb.slack.com/archives/C01BYDC5C93/p1692810269238919

@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2023

🦋 Changeset detected

Latest commit: ff62961

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
rrweb Patch
rrweb-snapshot Patch
rrdom Patch
rrdom-nodejs Patch
rrweb-player Patch
@rrweb/types Patch
@rrweb/web-extension Patch
rrvideo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@colingm
Copy link
Contributor Author

colingm commented Oct 24, 2023

@Juice10 any chance you can take a look here as you had context on the original slack question?

@colingm
Copy link
Contributor Author

colingm commented May 1, 2024

@Juice10 anything that might need to be done here to get this minor change in?

@colingm colingm force-pushed the cross-origin-return branch 2 times, most recently from 0538b09 to 82fc65d Compare May 1, 2024 18:03
If we have cross origin record turned on but we are in a child
frame that has the same origin as its parent we end up in sort
of an inefficient state. We will start the recording, record
mutations, but then never actually emit them anywhere since
inEmittingFrame and passEmitsToParent are both false. This
is a waste of resources and we might as well just never start
the recording.
@YunFeng0817
Copy link
Member

@colingm Can you repost or screenshot the original issue here? The message in the slack channel is no longer available to us.
This PR actually looks good to me. I'm willing to merge this in.

@rrweb-io rrweb-io deleted a comment from changeset-bot bot May 27, 2024
@colingm
Copy link
Contributor Author

colingm commented May 28, 2024

@YunFeng0817 yeah I don't have access to the exact text but my first comment/description for the PR explain the same thing I explained in slack. In slack I just brought up that idea and @Juice10 said yeah that it is kind of wasteful to keep same origin child frames running if you have cross origin recording turned on

@Juice10 Juice10 merged commit d7cf8dd into rrweb-io:master May 29, 2024
6 checks passed
jeffdnguyen pushed a commit to pendo-io/rrweb that referenced this pull request Jul 29, 2024
jeffdnguyen pushed a commit to pendo-io/rrweb that referenced this pull request Jul 29, 2024
billyvg pushed a commit to getsentry/rrweb that referenced this pull request Sep 17, 2024
jxiwang pushed a commit to amplitude/rrweb that referenced this pull request Oct 17, 2024
jxiwang pushed a commit to amplitude/rrweb that referenced this pull request Oct 17, 2024
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.

3 participants