Skip to content

feat: add hint to public capture methods - #8955

Open
itaybre wants to merge 1 commit into
feat/hints-apifrom
feat/hints-capture-api
Open

feat: add hint to public capture methods#8955
itaybre wants to merge 1 commit into
feat/hints-apifrom
feat/hints-capture-api

Conversation

@itaybre

@itaybre itaybre commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Thread user-provided SentryHint through SentrySDKSentryHubSentryClient capture methods (event, error, exception, message)
  • Add hint: parameter variants to ObjC (SentryObjCSDK, SentryObjCHub) and Swift (SentrySDK, SentryHub) public APIs
  • Simplify existing non-hint capture overloads to delegate to hint variants with nil
  • Add tests verifying user-provided hints with custom extras flow through to beforeSendWithHint

Stacked on #8942.

Test plan

  • make format passes
  • make analyze passes
  • make build-ios FOR_AGENTS=true passes
  • 4 new SentryClientTests verify hint flows through for event, error, exception, and message capture
  • make generate-public-api needs Xcode 16 (current env has Xcode 26) — sdk_api*.json included from make format run

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against fa59ace

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8a15571. Configure here.

let scope = Scope(scope: SentrySDKInternal.currentHub().scope)
block(scope)
return SentrySDKInternal.capture(event: event, scope: scope, hint: hint)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SentrySDK hint methods lack ObjC

Medium Severity

The new SentrySDK hint overloads omit the #if !SDK_V10 @objc(...) annotations that every other public capture method uses. In V9, SentrySDK is the ObjC entry point, so [SentrySDK captureEvent:withHint:] and the error, exception, and message equivalents are unavailable. SentryHub hint methods are @objc, and SentryObjCSDK only helps apps that import that separate module.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8a15571. Configure here.

Thread user-provided SentryHint through
SentrySDK -> SentryHub -> SentryClient capture
methods, matching sentry-java's pattern for
beforeSend callbacks.
@itaybre
itaybre force-pushed the feat/hints-capture-api branch from 8a15571 to fa59ace Compare September 5, 2026 01:06
@itaybre itaybre added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Sep 5, 2026
@sentry

sentry Bot commented Sep 5, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.27.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1222.18 ms 1252.32 ms 30.14 ms
Size 24.14 KiB 1.32 MiB 1.30 MiB

Baseline results on branch: feat/hints-api

Startup times

Revision Plain With Sentry Diff
d23eee9 1221.69 ms 1261.77 ms 40.08 ms

App size

Revision Plain With Sentry Diff
d23eee9 24.14 KiB 1.32 MiB 1.30 MiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant