Skip to content

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

Merged
Yuyz0112 merged 2 commits intorrweb-io:masterfrom
JohnPhamous:patch-1
Apr 9, 2021
Merged

Don't rebuildFullSnapshot if it's the first run#532
Yuyz0112 merged 2 commits intorrweb-io:masterfrom
JohnPhamous:patch-1

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?

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