ref(examples): migrate to context scope API - #1406
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2cae626. Configure here.
| } | ||
|
|
||
| sentry.CaptureException(errWithExtra) | ||
| sentry.CaptureException(context.Background(), errWithExtra) |
There was a problem hiding this comment.
ConfigureScope data ignored by captures
Medium Severity
ConfigureScope still writes to the hub scope, but the migrated capture helpers now apply GlobalScope or a context scope. Tags, user data, and event processors set this way are no longer attached to the captured events.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 2cae626. Configure here.
| func addBreadcrumbs() { | ||
| sentry.AddBreadcrumb(&sentry.Breadcrumb{ | ||
| sentry.AddBreadcrumb(context.Background(), &sentry.Breadcrumb{ | ||
| Message: "Random breadcrumb 1", |
There was a problem hiding this comment.
Bug: The call to sentry.AddBreadcrumb in the example code provides two arguments, but the function signature only expects one, causing a compilation error.
Severity: MEDIUM
Suggested Fix
Update the calls to sentry.AddBreadcrumb in _examples/feature-showcase/main.go to match the function's signature by removing the first argument, context.Background(). The call should only pass the *sentry.Breadcrumb struct.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: _examples/feature-showcase/main.go#L73-L75
Potential issue: The example code in `_examples/feature-showcase/main.go` calls
`sentry.AddBreadcrumb` with two arguments, `context.Background()` and a
`*sentry.Breadcrumb`. However, the actual function signature for `sentry.AddBreadcrumb`
in `sentry.go` only accepts a single argument: `breadcrumb *Breadcrumb`. This mismatch
between the function call and its definition will cause a compilation error, preventing
the example from being built.
Also affects:
_examples/feature-showcase/main.go:78~80_examples/feature-showcase/main.go:82~84
Did we get this right? 👍 / 👎 to inform future reviews.


Description
Refactor all examples to use the new scopes 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 💬