Skip to content

Upload crashes using a background URLSession #271

@CraigSiemens

Description

@CraigSiemens

Platform:

  • iOS
  • tvOS
  • MacOS
  • watchOS

Swift:

  • Yes -> If yes, which version? 4.2.1
  • No

sentry-cocoa installed with:

  • CocoaPods
  • Carthage
  • Manually

Version of sentry-cocoa:
4.1.0


I have following issue:
If the app is stuck in a state where it crashes on launch, the crashes are never sent to sentry. These types of crashes do appear on Crashlytics.

If your app is running on an OS that supports it (OS X 10.9+, iOS 7.0+), Crashlytics will submit most reports using out-of-process background networking operations. This results in a significant improvement in reliability of reporting, as well as power and performance wins for your users.

Source: Crashlytics.h

Steps to reproduce:

Client.shared = try Client(dsn: "...")
try Client.shared?.startCrashHandler()
Client.shared?.crash()

Actual result:
Crash logs never show up on sentry until the bug is fixed and deployed to the app that is crashing

Expected result:
Sentry should create the network request to upload the crash by using a background URLSession. This would allow the system to handle uploading the crash even if the app is unable to run.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions