-
-
Notifications
You must be signed in to change notification settings - Fork 209
-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Submitting almost any form from the mobile app throws and catches a Java error #6162
Comments
I think we probably need a better way to detect whether the form should be sent by sms as even if you have the capability to send via SMS you probably don't want to do that for all form types. Clearly the |
Ready for AT in
|
We are having heaps of trouble reproducing this because it is challenging to get the logs off the android app, since Chromium no longer attaches its debugger properly and a very clever hack by Diana around using feedback docs isn't accurate enough to catch the log. I'm going to have a think and see if there is another way we can AT this, but we may just say that because the act of saving reports still works this hasn't broken anything |
I managed to replicate this this morning by submitting a form and then immediately submitting a bug report. The resulting "feedback" doc contained the error in the logs. I've replicated it on two devices, the Tecno and my personal Nokia, so I'd say it's doable. |
Another option would be to install an old version of Chrome/Chromium and connect that to the device. |
I believe the problem is Chrome removing an old deprecated feature (https://developer.mozilla.org/en-US/docs/Web/API/Document/registerElement) that's used by the old inspector script. (If you open devtools in that blank debugger page, you can see an error about I had this idea that browser extensions might be loaded on that page, so we could leverage those and inject a polyfill of |
In the meantime I believe AT can continue on this issue using the feedback doc trick Diana mentioned above. |
After far too much faffing around I managed to reproduce this. No more log, everything else worked for me AFAICT. Back to you @dianabarsan to merge! |
Updates documentation around compressing app forms to SMS to reflect changes in webapp. medic/cht-core#6162
Updates forms2sms service so it requires the xml2sms form property to be set and truthy in order to generate SMS. If the value is Boolean, fallback to ODK standard, otherwise treat as angular expression. #6162
Merged |
In 3.5 we introduced the possibility of sending webapp forms to the server vis SMS: #4812
The code that generates the SMS content is here: https://github.com/medic/cht-core/blob/master/webapp/src/js/services/form2sms.js
The code that actually attempts sms sending is here: https://github.com/medic/cht-core/blob/master/webapp/src/js/services/submit-form-by-sms.js
We check for a field
xml2sms
in the form doc and fallback to the defaultodk-xform-compact-record-representation-for-sms
- which is documented here: https://opendatakit.github.io/xforms-spec/#compact-record-representation-(for-sms)In order to have a form be compactable to SMS, root element needs to have a
prefix
attribute. However, all form templates that I've seen used in our configurations have thisprefix
attribute, so all are compactable.examples:
https://github.com/medic/cht-core/blob/master/config/default/forms/app/pregnancy.xml#L671
https://github.com/medic/cht-core/blob/master/config/default/forms/app/undo_death_report.xml#L47
https://github.com/medic/cht-core/blob/master/config/default/forms/app/pregnancy_facility_visit_reminder.xml#L68
And every other
default
config form.When submitting such a form in the mobile app, an error is thrown and caught by the SubmitFormBySMS service:
This ends up polluting the console and nearly every feedback document generated (since it includes the latest n console messages).
It also contains a typo
Execption
.Typo appears to be coming from here: https://github.com/medic/medic-android/blob/master/src/main/java/org/medicmobile/webapp/mobile/MedicAndroidJavascript.java#L407
This also affects live instances - I first saw the error message in a feedback document generated in
muso-mali
instance. The feedback document reported a different error (fixed here: #5863) but it included a couple of previous log entries.To Reproduce
Steps to reproduce the behavior:
Optional: open the report a bug interface and submit. Check the document uploaded to the meta database on the server and observe it contains the Java exception log.
Expected behavior
We should not attempt sending SMS when the app does not have permissions.
Logs
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
The text was updated successfully, but these errors were encountered: