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

Add logs to DrawActivity #2449

Merged
merged 2 commits into from
Mar 17, 2021
Merged

Add logs to DrawActivity #2449

merged 2 commits into from
Mar 17, 2021

Conversation

ShivamPokhriyal
Copy link
Contributor

Jira: https://dimagi-dev.atlassian.net/browse/SAAS-11641

Some users have reported that they couldn't save the signature. More details on the ticket.
This PR will add logging to the DrawActivity to grab more information about the issue.

@@ -205,6 +207,8 @@ private void saveAndClose() {
setResult(AppCompatActivity.RESULT_OK);
} catch (FileNotFoundException e) {
e.printStackTrace();
// We shouldn't have gotten a file not found exception since we're using ImageWidget.getTempFileForImageCapture.
Logger.log(LogTypes.TYPE_ERROR_DESIGN, "Couldn't save signature at " + output.toString() + " because of" + e.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

can output be null ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good question. Umm, Although it gets set in onCreate here and here but it could get null maybe.

Though, I think the FileNotFoundException exception would only be thrown when the output is non-null. Otherwise it'd have thrown an NPE right? So I'm assuming that it's safe to access it here.

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good

@shubham1g5
Copy link
Contributor

Another area to survey and add logging might be when DrawActivity return result to the Form entry and see if the result is reliably returned to Form Entry or not.

@ShivamPokhriyal
Copy link
Contributor Author

see if the result is reliably returned to Form Entry or not.

I'm afraid I don't understand what you meant here.
Do you mean it's possible that DrawActivity setResult and finishes but FormEntryActivity doesn't get callback on onActivityResult?

@shubham1g5
Copy link
Contributor

Do you mean it's possible that DrawActivity setResult and finishes but FormEntryActivity doesn't get callback on onActivityResult?

yes, I am worried because of the rotation if something funny is happening on the device causing the result to get lost.

@ShivamPokhriyal ShivamPokhriyal merged commit ed7c5c1 into commcare_2.51 Mar 17, 2021
@ShivamPokhriyal ShivamPokhriyal deleted the signature-logging branch March 17, 2021 10:09
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.

None yet

2 participants