[Android] [ANR] Send basic reports without ANR traces - #574
Conversation
| app_exit_description: Option<&str>, | ||
| is_file_size_optimization_enabled: bool, | ||
| ) -> WIPOffset<v_1::Report<'fbb>> { | ||
| if let Some(anr_trace) = anr_trace { |
There was a problem hiding this comment.
To clarify, now platform layer can pass a Optional (nullable) inputTraceStream. If is not null try to parse, if no errors return the full report. If parsing fails (could be a malformed/incomplete input stream raw report) still send a basic report without stack traces
75a2a77 to
fce2fa3
Compare
| return report; | ||
| } | ||
|
|
||
| build_anr_without_trace(builder, app_info, device_info, app_exit_description) |
There was a problem hiding this comment.
For the cases where we fail parsing due to incomplete data on the raw report, I still think we should have a general viz count of this error (we have a related project for this, I will add a ticket there and handled then)
There was a problem hiding this comment.
It would be nice if we included the failure in the report somehow but yeah can handle separately
| return report; | ||
| } | ||
|
|
||
| build_anr_without_trace(builder, app_info, device_info, app_exit_description) |
There was a problem hiding this comment.
It would be nice if we included the failure in the report somehow but yeah can handle separately
a868bee to
c5c142f
Compare
Problem
ApplicationExitInfo can return a null stacktrace sometimes via getTraceInputStream parameter given this definition on their docs
“Note that because these traces are kept in a separate global circular buffer, crashes may be overwritten by newer crashes (including from other applications), so this may still return null.”
If that’s the case, getPreviousRunInfo will return ANR as termination reason, but given no report is stored due to the lack of stactrace the count won’t increment in Issue pages/Callback/ANR workflows
For more context please refer to this doc
Solution
Resolves BIT-9198
If we fail to parse a trace (either because being nullable or invalid contents) instead of dropping the report will create a basic one empty stacks/threads using appExitDescription for classification (e.g. User Perceived ANR, BroadcastReceiver, Background ANR, etc).
Verification
Verified in capture-sdk shared-core bump pr bitdriftlabs/capture-sdk#1083