Skip to content

fix(cloudflare): Catch potential errors during flush and dispose#21976

Merged
JPeer264 merged 1 commit into
developfrom
jp/cloudflare-scheduled-flush-rejection
Jul 6, 2026
Merged

fix(cloudflare): Catch potential errors during flush and dispose#21976
JPeer264 merged 1 commit into
developfrom
jp/cloudflare-scheduled-flush-rejection

Conversation

@JPeer264

@JPeer264 JPeer264 commented Jul 6, 2026

Copy link
Copy Markdown
Member

ref: #21950

This makes sure that flush never fails in Cloudflare. The worst case scenario is that it falsifies the responses of the Worker itself, which shouldn't happen. flush and dispose are guarded with different try/catch blocks as dispose should run even if client.flush fails.

@JPeer264 JPeer264 self-assigned this Jul 6, 2026
@JPeer264 JPeer264 requested a review from a team as a code owner July 6, 2026 09:27
@JPeer264 JPeer264 requested review from andreiborza and mydea and removed request for a team July 6, 2026 09:27
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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 27.59 kB - -
@sentry/browser - with treeshaking flags 26.03 kB - -
@sentry/browser (incl. Tracing) 46.24 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.01 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.01 kB - -
@sentry/browser (incl. Tracing, Replay) 85.49 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.1 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.19 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.84 kB - -
@sentry/browser (incl. Feedback) 44.76 kB - -
@sentry/browser (incl. sendFeedback) 32.38 kB - -
@sentry/browser (incl. FeedbackAsync) 37.51 kB - -
@sentry/browser (incl. Metrics) 28.67 kB - -
@sentry/browser (incl. Logs) 28.91 kB - -
@sentry/browser (incl. Metrics & Logs) 29.59 kB - -
@sentry/react 29.38 kB - -
@sentry/react (incl. Tracing) 48.51 kB - -
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.11 kB - -
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.24 kB - -
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.54 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.77 kB - -
CDN Bundle (incl. Tracing, Replay) 85.7 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.78 kB - -
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.96 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.93 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.59 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.97 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.93 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.62 kB - -
@sentry/nextjs (client) 50.95 kB - -
@sentry/sveltekit (client) 46.65 kB - -
@sentry/core/server 78.38 kB - -
@sentry/core/browser 64.73 kB - -
@sentry/node-core 63.2 kB - -
@sentry/node 123.2 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.72 kB -0.01% -1 B 🔽
@sentry/node - without tracing 74.24 kB +0.01% +1 B 🔺
@sentry/aws-serverless 85.02 kB - -
@sentry/cloudflare (withSentry) - minified 181.68 kB +0.07% +115 B 🔺
@sentry/cloudflare (withSentry) 449.39 kB +0.05% +217 B 🔺

View base workflow run

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch

@JPeer264 JPeer264 merged commit 1bc2608 into develop Jul 6, 2026
87 checks passed
@JPeer264 JPeer264 deleted the jp/cloudflare-scheduled-flush-rejection branch July 6, 2026 11:44
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