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

ref: Refactor some any #14477

Merged
merged 4 commits into from
Nov 29, 2024
Merged

ref: Refactor some any #14477

merged 4 commits into from
Nov 29, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Nov 26, 2024

Refactoring some as any type casts we have to avoid this.

@mydea mydea self-assigned this Nov 26, 2024
Copy link
Contributor

github-actions bot commented Nov 26, 2024

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 23.13 KB +0.04% +9 B 🔺
@sentry/browser - with treeshaking flags 21.83 KB +0.05% +11 B 🔺
@sentry/browser (incl. Tracing) 35.53 KB +0.02% +4 B 🔺
@sentry/browser (incl. Tracing, Replay) 72.44 KB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.82 KB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.76 KB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 89.22 KB +0.01% +2 B 🔺
@sentry/browser (incl. Feedback) 39.87 KB +0.03% +11 B 🔺
@sentry/browser (incl. sendFeedback) 27.74 KB +0.04% +9 B 🔺
@sentry/browser (incl. FeedbackAsync) 32.55 KB +0.04% +10 B 🔺
@sentry/react 25.8 KB +0.03% +6 B 🔺
@sentry/react (incl. Tracing) 38.38 KB +0.01% +3 B 🔺
@sentry/vue 27.28 KB +0.03% +7 B 🔺
@sentry/vue (incl. Tracing) 37.33 KB +0.02% +4 B 🔺
@sentry/svelte 23.28 KB +0.04% +9 B 🔺
CDN Bundle 24.32 KB +0.05% +11 B 🔺
CDN Bundle (incl. Tracing) 37.2 KB +0.04% +14 B 🔺
CDN Bundle (incl. Tracing, Replay) 72.08 KB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 77.41 KB +0.03% +16 B 🔺
CDN Bundle - uncompressed 71.45 KB +0.05% +33 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 110.5 KB +0.03% +33 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 223.57 KB +0.02% +33 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 236.79 KB +0.02% +33 B 🔺
@sentry/nextjs (client) 38.7 KB +0.03% +10 B 🔺
@sentry/sveltekit (client) 36.05 KB +0.02% +7 B 🔺
@sentry/node 135.08 KB +0.01% +6 B 🔺
@sentry/node - without tracing 97.14 KB +0.01% +4 B 🔺
@sentry/aws-serverless 109.43 KB +0.01% +2 B 🔺

View base workflow run

@mydea mydea force-pushed the fn/refactor-some-any branch 3 times, most recently from ca3b2e3 to 9b73900 Compare November 29, 2024 10:29
@@ -211,8 +211,7 @@ export function addContextToFrame(lines: string[], frame: StackFrame, linesOfCon
* @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)
*/
export function checkOrSetAlreadyCaught(exception: unknown): boolean {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (exception && (exception as any).__sentry_captured__) {
if (isAlreadyCaptured(exception)) {
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 was unsafe because you could pass e.g. undefined here which would throw.

@mydea mydea marked this pull request as ready for review November 29, 2024 10:39
@mydea mydea merged commit 343506b into develop Nov 29, 2024
151 checks passed
@mydea mydea deleted the fn/refactor-some-any branch November 29, 2024 13:08
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