Add capture(error:attachAllThreads:block:) combined API to SentrySDK
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Search for the existing capture(error:block:) and capture(error:attachAllThreads:) implementations and their related tests. Add the combined public overload, verify it preserves scoped mutations while forwarding attachAllThreads, and add or update coverage for both parameters together.
Written by the indexing model from the issue text.
Description
Currently, the public SentrySDK API exposes attachAllThreads and scope block mutation as separate methods with no way to use both together:
// Scope block only
@discardableResult public static func capture(
error: Error,
block: @escaping (Scope) -> Void
) -> SentryId
// attachAllThreads only
@discardableResult public static func capture(
error: Error,
attachAllThreads: Bool
) -> SentryId
There is no public method that combines both parameters.
Requested API:
@discardableResult public static func capture(
error: Error,
attachAllThreads: Bool,
block: @escaping (Scope) -> Void
) -> SentryId
Motivation:
When capturing errors where full thread stack traces are needed for specific events only (rather than globally via SentryOptions.attachAllThreads), there is currently no clean way to also mutate the scope for that same call. The only workarounds are:
Enabling attachAllThreads globally at init, which may not be desirable for performance reasons.
Using configureScope before the capture call, which sets data globally and requires manual cleanup.
Expected behaviour:
The method would behave identically to the existing capture(error:block:) variant (cloning the current scope and applying mutations only to the captured event) while also forwarding the attachAllThreads flag to the underlying client.
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 421
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 115
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-cocoa
-
CI flaky-test Type: Tests
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
getsentry/sentry-cocoa#8879 · 1 comment ·
-
Cocoa Docs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
getsentry/sentry-cocoa#8488 · 1 comment ·
-
Cocoa Docs Task
Difficulty 2/5 Half a day Newbie friendliness 72/100
getsentry/sentry-cocoa#8487 · 1 comment ·
-
Cocoa Type: Testing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
getsentry/sentry-cocoa#8486 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
getsentry/sentry-cocoa#9069 · 1 comment ·
All issues in getsentry/sentry-cocoa
Similar issues
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ionic-team/capacitor#8616 ·