cht-android icon indicating copy to clipboard operation
cht-android copied to clipboard

Prompt before allowing bad URLs

Open alxndrsn opened this issue 10 years ago • 3 comments

Instead of rejecting bad URLs as is currently the case, instead display a confirmation dialog, e.g.:

Warning: this URL does not point to a live Medic Mobile webapp. Do you want to use it anyway?

[ back ] [ use it anyway ]

alxndrsn avatar Nov 18 '15 15:11 alxndrsn

Related to #26

garethbowen avatar Feb 14 '20 00:02 garethbowen

@garethbowen why we would allow users (not just developers) to provide invalid URLs? I don't think it's a good idea, but maybe there is a good reason.

There is a environment variable that acts as flag: DISABLE_APP_URL_VALIDATION, that allows developers at build time to assemble any flavor disabling the validation: https://github.com/medic/cht-android/blob/672a2736abff32307a3dde639760122976a8558c/Makefile#L65-L66 allowing to load URLs that aren't CHT apps, but this options is used for developers who know what they are doing.

We also use it to run one of the UI tests: https://github.com/medic/cht-android/blob/672a2736abff32307a3dde639760122976a8558c/Makefile#L82-L85

Maybe what we should do is add documentation about this feature, but close the issue.

mrsarm avatar Oct 07 '21 13:10 mrsarm

I can't remember exactly why this was raised either, and it's now so ancient I'm happy to just close it. The only thing I can think of is testing something out, and you don't want to have to build the apk from scratch.

Let's add the documentation and close, like you suggest.

garethbowen avatar Oct 07 '21 20:10 garethbowen