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

Produce Swift diagnostics for all types of crashes. #257

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

matux
Copy link
Collaborator

@matux matux commented Feb 3, 2023

Description of the change

This PR adds crash parsing abilities that allows us to dig deep into a crash info deeply nested map that comes from the OS (and is pre-digested by KSCrash), to find extra information with details that can be used to produce diagnostics.

The Swift Rollbar Demo has also been greatly expanded with multiple types of crashes.

~8700 lines correspond to a crash report used in unit tests. Another +200 to Xcode related project files such as schemes, hopefully knowing this makes the PR less scary.


RollbarCrashDiagnosticFilter class is our hook into KSCrash report post-crash processing that happens the next time the app is opened after a crash occurred, and before sending the report to Rollbar.

The entry point is the filterReports function. We receive an array of reports, each report is a hashmap (a Dictionary in Apple parlance), that we validate for correctness and then diagnose by producing the diagnostics we want and injecting them back into the hashmap which we tend send back to the KSCrash processing pipeline, where we eventually receive it and send it to Rollbar.

Diagnostic/RollbarCrashDiagnosticFilter.swift would be a good place to start a review.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@matux matux self-assigned this Feb 3, 2023
@matux matux force-pushed the diagnostics branch 2 times, most recently from 37c5bf3 to de8af80 Compare February 3, 2023 02:59
@matux matux marked this pull request as ready for review February 14, 2023 02:51
@matux matux requested a review from diegov February 14, 2023 03:04
Validate crash reports before diagnosis, propagating errors.
Simplified validation and error propagation.
Unit tests.
Copy link
Contributor

@waltjones waltjones left a comment

Choose a reason for hiding this comment

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

Nice improvement! 💪

@matux matux merged commit 7b8bb76 into collect_crashes_with_stacktraces Feb 14, 2023
@matux matux deleted the diagnostics branch February 14, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants