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: canvas quality value #1727

Merged
merged 4 commits into from
Feb 11, 2025
Merged

fix: canvas quality value #1727

merged 4 commits into from
Feb 11, 2025

Conversation

pauldambra
Copy link
Member

when clamping canvas quality to range we aren't first checking it's a number 😓

this improves that and adds a matrix test to validate the config parsing

Copy link

vercel bot commented Feb 11, 2025

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

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Feb 11, 2025 1:57pm

@pauldambra pauldambra requested review from veryayskiy and a team February 11, 2025 12:06
@pauldambra pauldambra added the bump patch Bump patch version when this PR gets merged label Feb 11, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes a bug in canvas recording quality handling by properly converting string values to numbers before applying range validation.

  • Added type safety and parseFloat conversion for canvas quality values in src/extensions/replay/sessionrecording.ts
  • Added comprehensive test matrix in sessionrecording.test.ts to validate quality/fps parsing edge cases
  • Fixed default value handling (0.4 for quality, 4 for fps) when values are null/undefined
  • Improved clampToRange function usage by providing explicit default values

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

github-actions bot commented Feb 11, 2025

Size Change: +650 B (+0.02%)

Total Size: 3.3 MB

Filename Size Change
dist/array.full.es5.js 268 kB +65 B (+0.02%)
dist/array.full.js 370 kB +65 B (+0.02%)
dist/array.full.no-external.js 369 kB +65 B (+0.02%)
dist/array.js 183 kB +65 B (+0.04%)
dist/array.no-external.js 181 kB +65 B (+0.04%)
dist/main.js 184 kB +65 B (+0.04%)
dist/module.full.js 370 kB +65 B (+0.02%)
dist/module.full.no-external.js 369 kB +65 B (+0.02%)
dist/module.js 183 kB +65 B (+0.04%)
dist/module.no-external.js 181 kB +65 B (+0.04%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 216 kB
dist/customizations.full.js 13.8 kB
dist/dead-clicks-autocapture.js 14.5 kB
dist/exception-autocapture.js 9.51 kB
dist/external-scripts-loader.js 2.64 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 69.4 kB
dist/surveys.js 72.4 kB
dist/tracing-headers.js 1.76 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@pauldambra pauldambra merged commit 8142493 into main Feb 11, 2025
25 checks passed
@pauldambra pauldambra deleted the fix/canvas-quality branch February 11, 2025 17:06
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