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

Use typed crash reports #516

Merged
merged 13 commits into from
Jun 25, 2024
Merged

Use typed crash reports #516

merged 13 commits into from
Jun 25, 2024

Conversation

bamx23
Copy link
Collaborator

@bamx23 bamx23 commented Jun 23, 2024

The filters API was using dictionary in definitions but actually the report there can become a string or a data.
There's no nice way to implement union type or enum with associated values in ObjC. So this is a kind of workaround.

@bamx23 bamx23 requested a review from GLinnik21 June 23, 2024 14:13
@bamx23 bamx23 marked this pull request as ready for review June 25, 2024 22:19
@@ -37,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
* user cancelling the operation).
* @param error Non-nil if an error occurred.
*/
typedef void(^KSCrashReportFilterCompletion)(NSArray<NSDictionary<NSString *,id> *>* _Nullable filteredReports,
typedef void(^KSCrashReportFilterCompletion)(NSArray<KSCrashReport*>* _Nullable filteredReports,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The key issue was here. This callback would crash if implemented with Swift and the value type is not a dictionary.

Copy link
Collaborator

@GLinnik21 GLinnik21 left a comment

Choose a reason for hiding this comment

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

Thanks! Tests are great!

@GLinnik21 GLinnik21 merged commit 989497e into master Jun 25, 2024
20 checks passed
@GLinnik21 GLinnik21 deleted the add-report-type branch June 25, 2024 23:39
@bamx23 bamx23 mentioned this pull request Jun 26, 2024
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

Successfully merging this pull request may close these issues.

2 participants