You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When entering in a URL on the unbranded app and accidentally entering space before or after the URL, errors are caused.
We should likely trim leading and trailing spaces for a better user experience since spaces at those positions in the URL are not legal chars (but are mid URL!)
Tested on
Android 11
Pixel 3a
Unbranded 0.8.0 webview
Error 1
The first error is that we give different messages:
https://example.com - leading space and NO trailing slash, error is: "must be a valid URL"
https://example.com/ - leading space and YES trailing slash, error is: "URL is not a medic-webapp instance"
https://example.com - trailing space and NO trailing slash, error is: "unable to contact server"
https://example.com/ - trailing space and YES trailing slash, error is: "URL is not a medic-webapp instance"
steps to reproduce:
download unbranded android app
enter url with leading or trailing space
click "save"
expected: launch app connecting to URL
actual: errors per above
Error 2
After entering a URL with a space at the beginning and no trailing slash, the launch screen now has a URL entry that when you click the app crashes
steps to reproduce:
download unbranded android app
enter url with leading space and no trailing slash: https://example.com
click "save"
see error c
use back button to to back to launch screen
click top entry for the URL you just entered on step two
expected: launch app connecting to URL (ideally), or at least show error URL is not a medic-webapp instance"
actual: app crashes b/c Attempt to invoke virtual method 'void android.widget.TextView.setError(java.lang.CharSequence)' on a null object reference at org.medicmobile.webapp.mobile.SettingsDIalogActivity.a(SettingsDialogActivity.java:8) (sorry - manually transcribing from screenshot - there may be typos here - see attached)
Screenshots
The text was updated successfully, but these errors were encountered:
jkuester
changed the title
Spaces in URL on unbranded app cause errors
Allow users to set cht-core URLs with leading or trailing spaces (and trailing slash) on unbranded app
Dec 10, 2021
Overview
When entering in a URL on the unbranded app and accidentally entering space before or after the URL, errors are caused.
We should likely trim leading and trailing spaces for a better user experience since spaces at those positions in the URL are not legal chars (but are mid URL!)
Tested on
Error 1
The first error is that we give different messages:
https://example.com
- leading space and NO trailing slash, error is: "must be a valid URL"https://example.com/
- leading space and YES trailing slash, error is: "URL is not a medic-webapp instance"https://example.com
- trailing space and NO trailing slash, error is: "unable to contact server"https://example.com/
- trailing space and YES trailing slash, error is: "URL is not a medic-webapp instance"steps to reproduce:
expected: launch app connecting to URL
actual: errors per above
Error 2
After entering a URL with a space at the beginning and no trailing slash, the launch screen now has a URL entry that when you click the app crashes
steps to reproduce:
https://example.com
expected: launch app connecting to URL (ideally), or at least show error URL is not a medic-webapp instance"
actual: app crashes b/c
Attempt to invoke virtual method 'void android.widget.TextView.setError(java.lang.CharSequence)' on a null object reference at org.medicmobile.webapp.mobile.SettingsDIalogActivity.a(SettingsDialogActivity.java:8)
(sorry - manually transcribing from screenshot - there may be typos here - see attached)Screenshots
The text was updated successfully, but these errors were encountered: