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: recordings that are paused for their whole duration #1626

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

pauldambra
Copy link
Member

see: https://posthoghelp.zendesk.com/agent/tickets/22367

The user is using the URL pause list to entirely block domains. We wrote the feature thinking about pages within otherwise captured recordings so we don't completely stop emitting when paused. Which meant in combination with full page loads we would eventually emit an e.g. 40 minute session, with an apparent length of 0 seconds, that had an initial empty full snapshot and some network calls but nothing else

no bueno

let's not do that. we now explicitly check if the recording is paused and do not flush to the backend if so.

Copy link

vercel bot commented Dec 20, 2024

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

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Dec 20, 2024 9:18am

@@ -2312,48 +2311,55 @@ describe('SessionRecording', () => {
)
})

it('flushes buffer and includes pause event when hitting blocked URL', async () => {
it('does not flush buffer and includes pause event when hitting blocked URL', async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

that means that flushing before pausing is no longer safe.

really we should detect if we've ever flushed and then flush or not based on that but it's better to avoid this completely

this._urlBlocked = true
document?.body?.classList?.add('ph-no-capture')
Copy link
Member Author

Choose a reason for hiding this comment

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

this snuck past me in the initial implemention. naughty paul
this doesn't just add belt and braces for not capturing the DOM, it stops other capture like autocapture too... no bueno

@pauldambra pauldambra requested a review from a team December 20, 2024 09:20
@pauldambra pauldambra added the bump patch Bump patch version when this PR gets merged label Dec 20, 2024
Copy link

Size Change: -2.4 kB (-0.07%)

Total Size: 3.22 MB

Filename Size Change
dist/array.full.es5.js 262 kB -247 B (-0.09%)
dist/array.full.js 365 kB -241 B (-0.07%)
dist/array.full.no-external.js 364 kB -241 B (-0.07%)
dist/array.js 179 kB -237 B (-0.13%)
dist/array.no-external.js 178 kB -237 B (-0.13%)
dist/main.js 180 kB -237 B (-0.13%)
dist/module.full.js 365 kB -241 B (-0.07%)
dist/module.full.no-external.js 364 kB -241 B (-0.07%)
dist/module.js 179 kB -237 B (-0.13%)
dist/module.no-external.js 178 kB -237 B (-0.13%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 206 kB
dist/customizations.full.js 12.6 kB
dist/dead-clicks-autocapture.js 14.4 kB
dist/exception-autocapture.js 9.48 kB
dist/external-scripts-loader.js 2.48 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 57.6 kB
dist/surveys.js 63.3 kB
dist/tracing-headers.js 1.76 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

@@ -1290,7 +1288,6 @@ export class SessionRecording {
}

this._urlBlocked = false
document?.body?.classList?.remove('ph-no-capture')
Copy link
Member

Choose a reason for hiding this comment

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

All the other changes make sense, this one does not feel related to the original issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, it's totally fly-by, commented on above. i don't think we should be doing that

@pauldambra pauldambra merged commit 9eaf9bc into main Dec 20, 2024
32 checks passed
@pauldambra pauldambra deleted the fix/toti-paused-recordings branch December 20, 2024 12:49
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