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

fix: do not start recording buffer without id #1215

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Jun 1, 2024

Things used to start undefined, and they do so much less now

As an effect of that, we start session recording with an absent session and window id

This makes a persistent buffer hard to make since we have no reproducible key

We always have a session manager when we start now, so we can always start with an id

This is mostly tricky in tests, because we have a mock rrweb and then fake around the behavior of snapshots on initialisation

Copy link

vercel bot commented Jun 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Jun 1, 2024 4:51pm

Copy link

github-actions bot commented Jun 1, 2024

Size Change: +273 B (+0.03%)

Total Size: 973 kB

Filename Size Change
dist/array.full.js 234 kB +69 B (+0.03%)
dist/array.js 131 kB +68 B (+0.05%)
dist/es.js 131 kB +68 B (+0.05%)
dist/module.js 131 kB +68 B (+0.05%)
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 12.2 kB
dist/recorder-v2.js 109 kB
dist/recorder.js 109 kB
dist/surveys-module-previews.js 57.8 kB
dist/surveys.js 59.5 kB

compressed-size-action

@pauldambra pauldambra requested a review from a team June 1, 2024 08:02
@pauldambra pauldambra added the bump patch Bump patch version when this PR gets merged label Jun 1, 2024
Copy link
Contributor

@daibhin daibhin left a comment

Choose a reason for hiding this comment

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

One thing I noticed in the rrweb spec recently is the concept of checkouts: https://github.com/rrweb-io/rrweb/blob/d7cf8dd07547f6fb22ef82e341a88357c4053bd3/guide.md#checkout

Haven't looked into it fully but it seems like they have methods for capturing the last X events or taking a full snapshot every X ms. Just thought I'd flag it in case we're rebuilding things for the buffer that already exist:

  • They suggest checkoutEveryNth is good for capturing events before an error occurred
  • Maybe checkoutEveryNms could replace some of our custom timer logic

@pauldambra
Copy link
Member Author

yeah, i tried the checkout every X once and it conflicts with a lot of our custom checkout (or vice versa our custom tracking conflicts with it)

might be worth an attempt to strip this back and save on bundle if nothing else 🤔

@pauldambra
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants