Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Fix error message for empty stacktrace files #375

Conversation

MatkovIvan
Copy link
Contributor

@MatkovIvan MatkovIvan commented May 8, 2018

HockeyLog.warn("The crash data is invalid");
deleteStackTrace(weakContext, filename);
if (listener != null) {
listener.onCrashesSent();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is that not onNoCrashesFound since we are not sending anything?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah because we already onCrashesFound earlier. Well it's weird then, maybe we should just call onCrashesNotSent then?

Copy link
Collaborator

@guperrot guperrot May 18, 2018

Choose a reason for hiding this comment

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

Also there is no unit test for that, we should probably add some.

HockeyLog.warn("The crash data is invalid");
deleteStackTrace(weakContext, filename);
if (listener != null) {
listener.onCrashesNotSent();
Copy link
Collaborator

@guperrot guperrot May 18, 2018

Choose a reason for hiding this comment

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

One thing I don't understand is that we can have multiple stack traces.
This method is called in a loop, yet at first invalid stack trace you are calling listener. Isn't that the wrong thing to do? I thought the listener would be called at the end of all the sending operations for all crashes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Edit: actually we call it for each crashes on success but no parameter is passed, I guess design issue and I was confused as in AppCenter we pass the report as a parameter for those.

@guperrot guperrot dismissed their stale review May 18, 2018 20:48

Canceling requested change, need to re-review now with latest pushes.

try {
stacktrace = contentsOfFile(weakContext, filename);
} catch (Exception e) {
HockeyLog.error("Failed to read crash data", e);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this catch block is executed, then we go to line 412 and check length on a null stacktrace object. Shouldn't that crash? According to me the new unit test covers only empty stack trace case. I would suggest calling listener and cleaning retry counter too for null case.

@MatkovIvan MatkovIvan force-pushed the fix/message-for-empty-stacktrace branch from 4e27b64 to 2874014 Compare May 21, 2018 15:48
@ElektrojungeAtWork
Copy link
Contributor

Anything blocking us from merging this?

@MatkovIvan
Copy link
Contributor Author

@TroubleMakerBen It's ready to go

@ElektrojungeAtWork ElektrojungeAtWork merged commit 30eafc6 into bitstadium:develop Jun 12, 2018
@MatkovIvan MatkovIvan deleted the fix/message-for-empty-stacktrace branch August 9, 2018 07:36
@alex-margaritov alex-margaritov mentioned this pull request Aug 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants