Skip to content

Conversation

waltjones
Copy link
Contributor

Description of the change

Background:
When a replay is triggered before the first full snapshot is emitted, a "must have 3 events" error is raised.

This PR adds a recorder flag to track when the recorder is ready, allowing a warning to be logged rather than an error on this condition.

Notes:

  • This has a direct benefit to customers who are experiencing this issue. With the warning, it will now be obvious when the "must have 3 events" error has a different root cause.
  • This logs a warning and does not raise, since the recorder not being ready is not an error condition.
  • rrweb begins building the full snapshot after the load event, regardless of how early the record function is called.
  • The recordAfter option can be set by the user to DOMContentLoaded to allow rrweb to build the full snapshot earlier on that event. This may not be desirable, but the user has the option. https://github.com/rrweb-io/rrweb/blob/master/guide.md#options

Type of change

  • New feature (non-breaking change that adds functionality)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Copy link
Contributor

@matux matux left a comment

Choose a reason for hiding this comment

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

Nice solution!

@waltjones waltjones merged commit 2d86760 into master Sep 26, 2025
4 checks passed
@waltjones waltjones deleted the waltjones/recorder-ready branch September 26, 2025 14:11
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