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

It's possible to delete a form just after another one was sent #6125

Open
dbemke opened this issue May 6, 2024 · 2 comments
Open

It's possible to delete a form just after another one was sent #6125

dbemke opened this issue May 6, 2024 · 2 comments
Assignees

Comments

@dbemke
Copy link

dbemke commented May 6, 2024

ODK Collect version

the master version ee9b02a

Android version

10, 14

Device used

Redmi 9T, Pixel 7a

Problem description

It’s possible to delete a form being sent/ waiting to be sent in the scenario described below.
The first form in the queue has the "sending failed” icon in "Delete form" but following forms don’t get that icon while they’re being sent.
I'm not sure if the order of sending, time or "sending failed" status causes the issue.

Steps to reproduce the problem

  1. Send a form with a big attachment (e.g. All widgets form with a big jpg).
  2. Quickly after that send a submission of another form.
  3. Go to "Delete form- Saved Forms” and wait until you see the notification in the device (notification about successful upload of the first form).
  4. Quickly after that select the second form and delete it.

Expected behavior

It shouldn’t be possible to delete none of the forms (being sent or waiting to be sent).

@grzesiek2010 grzesiek2010 self-assigned this May 6, 2024
@grzesiek2010 grzesiek2010 added this to the v2024.2 milestone May 6, 2024
@grzesiek2010
Copy link
Member

This happens because with auto-send on, if we fill two forms one by one and click the send button two separate jobs are scheduled. We block deleting forms at the beginning of sending forms and unblock them at the end of this process within one job but not between two separate jobs. There might be some time before ending one job and starting another one when deleting forms becomes unblocked. From what I have noticed it's rather a short period of time. As a result, deleting forms is possible between the jobs. To handle this properly we should probably add a new column in the instances.db to track forms that are being sent no matter if their job has already started or not. Thanks to that approach:

  • we could fix this issue
  • we could block deleting particular forms that are being sent, not all of them
  • we could reflect this state in the U displaying that a form is being sent

I think it's rather for v2024.3 or even v2024.4 @seadowg do you agree?

@grzesiek2010 grzesiek2010 removed this from the v2024.2 milestone May 16, 2024
@seadowg
Copy link
Member

seadowg commented May 20, 2024

we could reflect this state in the U displaying that a form is being sent

Yeah I think we'd need to introduce something like this to fix the problem here. We currently don't have an internal or user visible state for "waiting to send" which would block this and it was a definitely a concern raised when changing the form end screen button from "finalize" to "send". Another alternative would be to have auto send check if there are more forms to send before finishing so the scenario just can't come up (although this might result in other confusing behaviours).

I personally don't feel like this is something we need to look into at the moment. That said, we could measure the impact fairly easily with an analytics event that fires if a form is being deleted before sending when auto send is enabled. @grzesiek2010 does that sound good to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: not ready
Development

No branches or pull requests

3 participants