-
Notifications
You must be signed in to change notification settings - Fork 6
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
feature/APMI-2820 iOS crash does not retain old screen name #2
base: main
Are you sure you want to change the base?
feature/APMI-2820 iOS crash does not retain old screen name #2
Conversation
changes in crashreporting.swift
@@ -84,7 +94,9 @@ func loadPendingCrashReport(_ data: Data!) throws { | |||
exceptionType = report.exceptionInfo.exceptionName | |||
} | |||
|
|||
let oldSessionId = String(decoding: report.customData, as: UTF8.self) | |||
let strArr = String(decoding: report.customData, as: UTF8.self).components(separatedBy: "|") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break if the user specifiers a screen name containing a |
. Please use something sensible like URL/URI encoding (which in Swift is apparently named addingPercentEncoding
) and the same keys we would report with the span.
Changed logic of saving sessionid and screen name as custom data.
linting issue solved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
@@ -24,6 +24,9 @@ let CrashReportingVersionString = "0.2.0" | |||
|
|||
var TheCrashReporter: PLCrashReporter? | |||
|
|||
let keyID = "SessionID" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might rename it sessionIdKey
and screenNameKey
or something similar, at the moment it's a bit hard to understand at first glance what is keyID
and keyName
} | ||
} | ||
|
||
func saveSessionIDInToCustomData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: InTo
-> Into
?
minor changes
PR failed because of following line.
|
@@ -84,7 +132,9 @@ func loadPendingCrashReport(_ data: Data!) throws { | |||
exceptionType = report.exceptionInfo.exceptionName | |||
} | |||
|
|||
let oldSessionId = String(decoding: report.customData, as: UTF8.self) | |||
guard let dict = dataToDictionary(data: report.customData) else {return} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make a best effort to report data, even if we are missing some fields. Missing the old session ID and/or the old screen name should not prevent us from reporting any crash reporting span.
remove guard let , send crash span if it has not sessionid or screen name data.
test case added to check that screen.name is there or not
changes in crashreporting.swift