ref!: remove hub API - #1407
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.
| func LastEventID() EventID { | ||
| hub := CurrentHub() | ||
| return hub.LastEventID() | ||
| return GlobalScope().LastEventID() |
There was a problem hiding this comment.
LastEventID misses typical captures
Medium Severity
LastEventID() now reads GlobalScope(), but captures only record an ID when ScopeFromContext is non-nil. CaptureException(context.Background(), err) after Init leaves the ID unset, so the package-level helper stays empty. Isolation-scope captures also never update GlobalScope.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.
| ctx = sentry.ContextWithScope(ctx, sentry.ScopeFromContext(h.defaultCtx)) | ||
| } | ||
| if hub == nil { | ||
| hub = h.defaultHub |
There was a problem hiding this comment.
Logrus provider drops traces
Medium Severity
SetContextProvider is documented to supply an operation-specific client, scope, or trace, but Fire only copies the provider scope onto the entry context. After scope.span was removed, spans live only on context, so the provider's active span is discarded and logs lose span correlation.
Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.
| // When logging without context, slog passes context.Background. Preserve the | ||
| // handler context so its client and scope defaults remain effective. | ||
| if sentry.ScopeFromContext(ctx) == nil { | ||
| ctx = sentry.ContextWithScope(ctx, sentry.ScopeFromContext(h.logger.GetCtx())) |
There was a problem hiding this comment.
Slog drops handler trace context
Medium Severity
When slog logs without a scope (including logger.Info, which passes context.Background()), the handler only copies the logger's scope onto the incoming context. The previous code used h.logger.GetCtx() wholesale, so an active span on the handler context is no longer applied and those logs lose trace linking.
Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.


Description
This removes the hub API.
Issues
Changelog Entry Instructions
To add a custom changelog entry, uncomment the section above. Supports:
For more details: custom changelog entries
Reminders
feat:,fix:,ref:,meta:)Stack created with GitHub Stacks CLI • Give Feedback 💬