Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression from 5.23: BugsnagEvent does not expose -depth #867

Closed
danhd123 opened this issue Oct 28, 2020 · 1 comment
Closed

Regression from 5.23: BugsnagEvent does not expose -depth #867

danhd123 opened this issue Oct 28, 2020 · 1 comment

Comments

@danhd123
Copy link

danhd123 commented Oct 28, 2020

Describe the bug

The depth property on BugsnagEvent appears to have been removed in #498, which listed depth as unused. However, it was deliberately added to BugsnagCrashReport and documented in #110 (based on request in #109), and our app used it to hide its own central error handling stack frames. This appears to have been a mistake; please add it back.

Steps to reproduce

  1. Have a project that uses Bugsnag 5.23.0
  2. Replace version in Podfile with 6.2.2
  3. pod install
  4. Observe that calls to +[Bugsnag notifyError:block:] in which the event (formerly report) in the block parameter had a depth adjustment now result in a compile error: Value of type 'BugsnagEvent' has no member 'depth'. All other errors in our app due to deprecations and renames seem to have workarounds or equivalents, but not the loss of depth.

Environment

  • Bugsnag version: 6.2.2
  • CocoaPods version: 1.9.3
  • Carthage version (if any): N/A
  • iOS/tvOS/macOS version(s): iOS 13.7
  • Simulator or physical device: iPhone XR
  • XCode version: 12.1 12A7403
  • Swift version (if applicable): 5.2

Example code snippet

...
    private func _reportError(_ error: Error, _ metadata: Metadata = [:], groupingHash: String? = nil, consoleMessage: String? = nil, file: StaticString, line: UInt) {
        Bugsnag.notifyError(error) { report in
            report.depth += 1
            report.addMetadata(metadata, section: "metadata")
            
            if let groupingHash = groupingHash {
                report.groupingHash = groupingHash
            }
            return true
        }
        ...
    }
...
Error messages: Value of type 'BugsnagEvent' has no member 'depth'

@mattdyoung
Copy link

Hi @danhd123

The depth property has been removed as we now support the same functionality and more in an OnSendError callback:
https://docs.bugsnag.com/platforms/ios/customizing-error-reports/#modifying-stack-traces

There is some guidance in the upgrade guide on how you could implement a direct replacement:
UPGRADING.md#depth-replacement

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

No branches or pull requests

2 participants