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

Don't rebuildFullSnapshot if it's the first run #532

Merged
merged 2 commits into from
Apr 9, 2021

Conversation

JohnPhamous
Copy link
Contributor

👋 I don't think we need to rebuild the full snapshot during the first play-through since we already do it when we initialize the player.

Before:

  • 1 rebuildFullSnapshot while initializing the player
  • 1 rebuildFullSnapshot while processing the FullSnapshot event

After:

  • 1 rebuildFullSnapshot while initializing the player

@JohnPhamous
Copy link
Contributor Author

@Yuyz0112 Could you take a look when you can?

@@ -459,6 +462,11 @@ export class Replayer {
break;
case EventType.FullSnapshot:
castFn = () => {
// Don't build a full snapshot during the first play through since we've already built it when the player was mounted.
if (this.firstPlay) {
Copy link
Member

Choose a reason for hiding this comment

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

where do we set firstPlay to truthy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, fixed the typo. It's initialized to true at first.

@Yuyz0112
Copy link
Member

Yuyz0112 commented Apr 9, 2021

Thanks!

@Yuyz0112 Yuyz0112 merged commit e892533 into rrweb-io:master Apr 9, 2021
@JohnPhamous JohnPhamous deleted the patch-1 branch April 9, 2021 17:40
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.

2 participants