Skip to content

fix(core): Stop supabaseIntegration from ending spans twice - #24126

Open
chargome wants to merge 1 commit into
developfrom
supabase-span-fix
Open

fix(core): Stop supabaseIntegration from ending spans twice#24126
chargome wants to merge 1 commit into
developfrom
supabase-span-fix

Conversation

@chargome

@chargome chargome commented Sep 7, 2026

Copy link
Copy Markdown
Member

Switches the Supabase auth and PostgREST wrappers to startSpanManual, since they already end their spans by hand and startSpan's automatic end was ending every span a second time, which spams OTel diag loggers with "You can only call end() on a span once".

Fixes #24116

The Supabase auth and PostgREST wrappers end their spans by hand once the
wrapped promise settles, but they ran inside a startSpan callback that also
ends the span when the callback's promise resolves. Every instrumented call
therefore ended its span twice, and OTel diag loggers reported
"You can only call end() on a span once" for each one.

Switch both wrappers to startSpanManual so the manual end is the only one.
Dropping the manual end instead would have extended each span to include
the caller's own then handlers, which the wrapper chains onto the promise
it returns.

Fixes #24116
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chargome chargome self-assigned this Sep 7, 2026
@chargome

chargome commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e6a1eaf. Configure here.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.7 kB added added
@sentry/browser - with treeshaking flags 27.01 kB added added
@sentry/browser - with treeshaking flags tracing without tracing 26.9 kB added added
@sentry/browser (incl. Tracing) 49.08 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 49.08 kB added added
@sentry/browser (incl. Tracing, Profiling) 52 kB added added
@sentry/browser (incl. Tracing, Replay) 88.63 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.86 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 93.31 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 106.26 kB added added
@sentry/browser (incl. Feedback) 46.19 kB added added
@sentry/browser (incl. sendFeedback) 33.76 kB added added
@sentry/browser (incl. FeedbackAsync) 38.86 kB added added
@sentry/browser (incl. Metrics) 29.67 kB added added
@sentry/browser (incl. Logs) 29.95 kB added added
@sentry/browser (incl. Metrics & Logs) 30.6 kB added added
@sentry/react 30.46 kB added added
@sentry/react (incl. Tracing) 51.29 kB added added
@sentry/vue 35.93 kB added added
@sentry/vue (incl. Tracing) 51.35 kB added added
@sentry/svelte 28.72 kB added added
CDN Bundle 30.44 kB added added
CDN Bundle (incl. Tracing) 49.61 kB added added
CDN Bundle (incl. Logs, Metrics) 32.67 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 51.54 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 73.33 kB added added
CDN Bundle (incl. Tracing, Replay) 87.17 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.03 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 93.1 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.04 kB added added
CDN Bundle - uncompressed 90.17 kB added added
CDN Bundle (incl. Tracing) - uncompressed 147.84 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.55 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.62 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.86 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.48 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.25 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.18 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.94 kB added added
@sentry/nextjs (client) 53.9 kB added added
@sentry/sveltekit (client) 49.52 kB added added
@sentry/core/server 38.49 kB added added
@sentry/core/browser 13.53 kB added added
@sentry/node 124.81 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB added added
@sentry/node - without tracing 88.51 kB added added
@sentry/node - without channel injection 104.12 kB added added
@sentry/aws-serverless 96.88 kB added added
@sentry/cloudflare (withSentry) - minified 201.59 kB added added
@sentry/cloudflare (withSentry) 501.44 kB added added

View base workflow run

@chargome
chargome marked this pull request as ready for review September 7, 2026 08:37
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.

supabaseIntegration double-ends every PostgREST span (span.end() inside a trace.startSpan callback that also auto-ends)

1 participant