feat(canvas): Add "maxCanvasSize" option for canvas#174
Merged
Conversation
This adds a configuration option to set a max size for canvas snapshots. This will scale down canvas snapshot images if they are larger than the configure size limit. The size configuration is width * height.
size-limit report 📦
|
c298lee
approved these changes
Apr 12, 2024
mydea
reviewed
Apr 15, 2024
| const resizedBitmap = | ||
| targetWidth === width && targetHeight === height | ||
| ? bitmap | ||
| : // resize bitmap to fit within maxsize |
Member
There was a problem hiding this comment.
what will happen if this is not supported? 🤔
Member
Author
There was a problem hiding this comment.
I'm not sure tbh, it could throw or it could ignore the options.
Member
Author
There was a problem hiding this comment.
My previous commit did the resizing manually with drawImage(), but I'd rather use the builtin since it's pretty well-supported. I think throwing and not capturing exceptions and in the other case, if it doesn't throw and just ignores the options and captures the original size, are both acceptable outcomes.
I'm going to merge as-is, but let me know what you think and I can follow-up.
billyvg
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 15, 2024
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
billyvg
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 15, 2024
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
billyvg
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 18, 2024
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
billyvg
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 19, 2024
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
billyvg
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 22, 2024
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174 Closes #10498
billyvg
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 22, 2024
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174 Closes #10498 Backport of #11617
mydea
pushed a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 23, 2024
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174 Closes #10498 Backport of #11617
billyvg
added a commit
that referenced
this pull request
Apr 26, 2024
This adds a configuration option to set a max size for canvas snapshots. This will scale down canvas snapshot images if they are larger than the configure size limit. The size configuration is width * height.
chargome
added a commit
that referenced
this pull request
Mar 25, 2026
Remove lerna and replace its two uses with lighter alternatives: - **`lerna version`** → `scripts/bump-version.js` — a ~80-line Node script that updates all workspace `package.json` versions and `@sentry-internal/*` cross-references to the exact new version. Modeled after [sentry-javascript#19325](getsentry/sentry-javascript#19325). - **`lerna run build:tarball`** → `turbo run build:tarball` — Turborepo is already used for all other cross-package tasks. Lerna was pulling in a large transitive dependency tree including packages with known vulnerabilities. This removes ~2,300 lines from `yarn.lock`. ### Dependabot alerts resolved **Fully resolved** (vulnerable package completely removed from lockfile): | Alert | Severity | Package | Summary | |-------|----------|---------|---------| | #217 | HIGH | `tar` | Symlink Path Traversal via Drive-Relative Linkpath | | #216 | HIGH | `tar` | Hardlink Path Traversal via Drive-Relative Linkpath | | #185 | HIGH | `tar` | Arbitrary File Read/Write via Hardlink Target Escape Through Symlink Chain | | #176 | HIGH | `tar` | Arbitrary File Creation/Overwrite via Hardlink Path Traversal | | #174 | HIGH | `tar` | Race Condition via Unicode Ligature Collisions on macOS APFS | | #172 | HIGH | `tar` | Arbitrary File Overwrite and Symlink Poisoning via Insufficient Path Sanitization | | #137 | HIGH | `axios` | SSRF and Credential Leakage via Absolute URL | **Partially resolved** (some vulnerable entries removed, but the package still exists via other dependency chains): | Alert | Severity | Package | Remaining source | |-------|----------|---------|-----------------| | #213, #208, #207, #205 | HIGH | `minimatch` | `markdownlint-cli`, `vite-plugin-dts` still pull in vulnerable versions | | #161 | HIGH | `glob` | `markdownlint-cli`, `web-ext-run` still pull in vulnerable versions | | #136, #135 | CRITICAL | `form-data` | `jest` (via jsdom) still pulls in `form-data@3.0.2` | | #158, #157 | MEDIUM | `js-yaml` | `@changesets/cli`, `jest` still pull in `js-yaml@3.14.1` | The partially resolved alerts will be addressed in later phases (Phase 6: mop up remaining — bumping `markdownlint-cli`, `@changesets/cli`, `jest`/rrvideo, etc.). Part of the ongoing effort to resolve all Dependabot alerts on this repo. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a configuration option to set a max size for canvas snapshots. This will scale down canvas snapshot images if they are larger than the configure size limit. The size configuration is width * height.