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

Revert "Do not mark forms as failed to send before sending" #5688

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jul 20, 2023

Closes #5687

What has been done to verify that this works as intended?

I've tested the fix manually.

Why is this the best possible solution? Were any other approaches considered?

In #5609 we removed marking forms as failed before sending them to avoid editing (this was a workaround) because we blocked editing finalized forms. Recently we have introduced the grace period and because of that wee need the workaround again.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Please test the scenario described in the issue.

Do we need any specific form for testing your changes? If so, please attach one.

No.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg added the high priority Should be looked at before other PRs/issues label Jul 20, 2023
@seadowg seadowg linked an issue Jul 20, 2023 that may be closed by this pull request
@seadowg
Copy link
Member

seadowg commented Jul 20, 2023

@getodk/testers in addition to checking this fixes the issue, I think doing some exploratory testing around sending, failed submissions and editing finalized forms would be good. This clearly an area we're having a hard time keeping intact with the recent behaviour changes, so some extra confidence would be nice!

@dbemke
Copy link

dbemke commented Jul 20, 2023

(I installed the CI build) Something is wrong with the snackbar when I send a form. Sometimes the snackbar appears and sometimes not.
I tried to reproduce it with finalizing the form- each time snackbar appears. I also tried sending a few forms with don't keep activities enabled and in this case the snackbar never appeared.

@dbemke
Copy link

dbemke commented Jul 21, 2023

It’s still possible to edit a form that is being sent.
Steps to reproduce:

  1. Change the server URL so that it’s wrong (e.g. add some letters).
  2. Go to any form.
  3. Go to end and Send the form.
  4. In the snackbar click View.
  5. Repeat steps 2-4 a few times (usually 3 times).

Usually the third form which is being sent/sending failed allows to edit after viewing it. I don’t know if the failed status of sending or the queue of forms that triggers the possibility to edit forms.

@dbemke
Copy link

dbemke commented Jul 21, 2023

Another way to reproduce it

Steps to reproduce:

  1. Settings- Form management- Auto send set to wifi only.
  2. Turn off the wifi.
  3. Finalize some forms.
  4. Turn on the wifi.
  5. Send a form.
  6. In the snackbar click View (this form is editable).
  7. Wait until all forms are sent.
  8. Send another form.
  9. In the snackbar click View (this form isn’t editable).

@grzesiek2010
Copy link
Member Author

grzesiek2010 commented Jul 21, 2023

I think it's because you are fast enough to open the form for editing before it's marked as submission failed (which is our workaround to block editing such forms). I'm pretty sure the same should be possible on v2023.1 but there is no snackbar so you would need to navigate to Edit Saved Form quickly and open such a form. Please give it a try. If the behavior is like I described I think we can leave it as-is.

@dbemke
Copy link

dbemke commented Jul 21, 2023

I checked 2023.1.1 (auto send: wifi only and the wifi off) if I Mark form as finalized and click "Save Form and Exit" the form is both in "Edit Saved Form" and "Send Finalized Form" so it's editable, so I guess in 2023.1.1 it was still possible to edit "ready to send" form.

@grzesiek2010
Copy link
Member Author

grzesiek2010 commented Jul 21, 2023

auto send: wifi only and the wifi off

no, no it has never worked like that. If you have auto-send enabled but the requirements are not met like in this case sending is not triggered and editing forms is not blocked.
Marking forms as submission failed what prevents them from being edited takes place just before uploading a particular form.
Because of the fact that it happens right before sending a form if you have let's say 5 forms to send one by one:

  • the first one will be blocked but the other 4 forms will be editable
  • then after sending the first one the second one will be blocked and the 3 others will be editable etc.

It's not a perfect mechanism but it worked like that and we should keep this for now. Thankfully in October, the problem will be gone.

@grzesiek2010
Copy link
Member Author

grzesiek2010 commented Jul 21, 2023

so comparing v2023.2.x (with this pr) to older versions where editing finalized forms was possible without the grace period (like v2023.1) I believe the behavior is similar. In both cases, if you are fast enough you might be able to edit a form that is queued to be sent.
The only difference is that now you have that snackbar and the view action so it's more prominent because you don't have to navigate to the list of forms where you can tap on a particular item and open a form for editing.

@seadowg do you have anything to add here?

@seadowg
Copy link
Member

seadowg commented Jul 21, 2023

@seadowg do you have anything to add here?

No! As far as I can see, this just moves us back to the v2023.1 behaviour as you said. One of the big motivations to prevent editing of finalized forms was to stop this edge case (being able to change a form while it sends) from occurring. Once the grace period ends/v2023.3 comes out, this will no longer be a problem (as @grzesiek2010 says).

@srujner
Copy link

srujner commented Jul 21, 2023

Tested with Success!

Verified on device with Android 13

Verified cases:

  • Issue Possible to edit a form while it is being sent #5687 is no longer reproducing
  • snackbar after sending a form
  • sending/finilizing wrong URL
  • sending forms with big-sized media
  • all auto send options
  • a few forms being sent at the same time
  • discarding edited media changes
  • Sending finalized Forms, Editing saved Forms, Viewing sent Forms, Deleting saved Forms;
  • All notifications: Tapping on notification, clicking on show details, exit from the error list;
  • Form version and media updates;
  • Automatic download and Failed automatic download,
  • Regression checks and Exploratory testing on Project settings and user settings;
  • Adding project manually or through QR code;
  • Switching between projects, adding duplicated projects;
  • Update settings from older version;
  • background recording form
  • background recording with audit form

@dbemke
Copy link

dbemke commented Jul 21, 2023

Tested with Success!

Verified on device with Android 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior verified high priority Should be looked at before other PRs/issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible to edit a form while it is being sent
4 participants