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

Count of pending submissions includes edits that it shouldn't #561

Closed
matthew-white opened this issue Dec 7, 2023 · 3 comments · Fixed by getodk/central-backend#1058
Closed
Assignees
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified bug entities Multiple Encounter workflows

Comments

@matthew-white
Copy link
Member

matthew-white commented Dec 7, 2023

From @dbemke in #517 (comment):

Problem description

There's a pending submission that cannot be converted via changing the setting "Create Entities as soon as Submissions are received by Central". I think it's not a submission that is pending but it might be an edit to the submission.

I'm not sure if submission edits are cause of that but I'm able to reproduce it with editing submissions.

URL of the page

https://staging.getodk.cloud/#/projects/56/entity-lists/participants/settings

Steps to reproduce the problem

  1. Setting "Create Entities when Submissions are marked as Approved” is on.
  2. Go to the form Entities create or update to submission and click +new.
  3. When Enketo view is opened, create a new entity.
  4. Go to Dataset- Settings- Entity Workflow and change the setting to "Create Entities as soon as Submissions are received by Central” and convert the pending submission to entity.
  5. Go to submissions and edit the submission that created the entity.
  6. Go to Dataset- Settings- Entity Workflow and change settings a few times and try to convert 1 pending submission to entity.

Screenshot

https://jam.dev/c/684f1ae8-4b72-40e3-8489-d85ceb00161d

Expected behavior

There should be no submissions that are perpetually pending.

Central version shown in version.txt

versions:
d2345d0713339b45045167bcf14e24dcf473bdf5 (v2023.4.0-5-gd2345d0)
+4b5d237c5d83f7fc5c64dce79229f9edd97cff62 client (v2023.4.0-46-g4b5d237c)
+c2580569befe146837d770185e49b61ebab5d06e server (v2023.4.0-44-gc2580569)
@matthew-white matthew-white added backend Requires a change to the API server needs testing Needs manual testing entities Multiple Encounter workflows labels Dec 7, 2023
@matthew-white
Copy link
Member Author

matthew-white commented Dec 7, 2023

In that project, there is one form that updates the participants entity list: https://staging.getodk.cloud/#/projects/56/forms/participant_create_update. The form has three submissions, all of which created entities. So there shouldn't be any pending submissions. I do think that the submission edit is the issue. In Backend, _unprocessedSubmissions() excludes all but the latest submission version, which means that if a submission created an entity, but in an earlier version, that creation isn't seen. Backend will count the submission as pending and will try to reprocess it. Reprocessing won't have an effect, because the submission has created an entity, and a single submission can only have a single effect on entities (#517): all that seems to be working. However, it does mean that there's no way to change the submission from being pending: there will perpetually be a submission incorrectly counted as pending.

@srujner
Copy link

srujner commented Dec 8, 2023

Tested with Success!

1 similar comment
@dbemke
Copy link

dbemke commented Dec 8, 2023

Tested with Success!

@dbemke dbemke added behavior verified Behavior has been manually verified and removed needs testing Needs manual testing labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified bug entities Multiple Encounter workflows
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

4 participants