getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
717 stars 1.38k forks source link

Changing language/theme during form entry blocks both match exactly and opening the form #6482

Closed dbemke closed 2 weeks ago

dbemke commented 3 weeks ago

ODK Collect version

the master version 2e63b33407128e7e17ca46241683945dd749c48f

Android version

10, 14

Device used

Redmi 9T, Pixel 7a

Problem description

Changing language/theme during form entry blocks match exactly and blocks opening the form. After that the user tries to open the form and sees info that "The form can’t be used” but at the same time there isn’t a progress bar in "Start new form”.

Steps to reproduce the problem

  1. Download user "trees” https://test.getodk.cloud/#/projects/575/app-users
  2. Go to ABC registration form.
  3. Fill the form, tap the three dots to go to settings and change the theme of the app (to create a savepoint).
  4. Wait for match exactly to run.
  5. Try to open the form.

    Expected behavior

    Both form entry and updates should be possible after changing language/theme during form entry.

seadowg commented 3 weeks ago

This is a bug! The both form updates and entry should be possible here. It's likely that this can also be reproduced by changing languages.

seadowg commented 3 weeks ago

@dbemke I'm pretty sure this will only be the case for scenarios where the theme/language are changed and is actually not related to save points at all. Could you confirm that for me by playing with other save point scenarios?

dbemke commented 3 weeks ago

the theme/language are changed and is actually not related to save points at all

interesting :) I'll try it out

seadowg commented 3 weeks ago

@WKobus also discovered that you can cause the same problem with these steps:

  1. Finalize entity form
  2. Open it in Ready to Send
  3. Try and start the same form again

It looks like this is because we open ViewOnlyFormHierarchyActivity after loading the form and then finish FormFillingActivity without cleaning up.

grzesiek2010 commented 3 weeks ago

@WKobus could you file a separate issue for your case? It is a distinct one so it will be better.

dbemke commented 3 weeks ago

I'm pretty sure this will only be the case for scenarios where the theme/language are changed and is actually not related to save points at all. Could you confirm that for me by playing with other save point scenarios?

A few tries and - savepoint after using "force stop" doesn't block match exactly or the form. I checked also if maybe it's the case with changing match exactly settings to get it running faster - it's not a factor in this issue. So as you said it's not the savepoint causing it.

seadowg commented 3 weeks ago

@alyblenkin it would be good to get your input on how we're thinking of fixing this. My current plan is to block access to the settings that cause the app to "restart" during form entry like this by disabling them and showing a summary like:

Screenshot 2024-10-30 at 16 23 37

And for clarity, the settings that will be disabled will be:

alyblenkin commented 3 weeks ago

@seadowg blocking access and showing a message sounds like a good plan.

My first thought was to add some sort of pill or icon to make to more obvious if they don't read carefully, but I think that over complicates things! There is a good icon for settings alert, but not really a good warning for theme and language.

So when users go to the settings page, they’ll see the supporting text for each setting that’s not available. If they’re adjusting settings while filling out the form using the menu, should we also show the the language is disabled? I don't know if dropdown lists all support text, so we may need to show it in the dialog?

seadowg commented 3 weeks ago

If they’re adjusting settings while filling out the form using the menu, should we also show the the language is disabled? I don't know if dropdown lists all support text, so we may need to show it in the dialog?

The "Setting not available..." text is used as the summary which is where the current setting would usually be shown. Just to be clear, the user is still able to change form language using the "Change language" button in the options menu - it's just the app language that they won't be able to change.

alyblenkin commented 3 weeks ago

Ah gotcha! That makes more sense!