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

Entity Worker Improvements #669

Closed
ktuite opened this issue Nov 14, 2022 · 0 comments · Fixed by #685
Closed

Entity Worker Improvements #669

ktuite opened this issue Nov 14, 2022 · 0 comments · Fixed by #685
Assignees
Labels
entities Multiple Encounter workflows

Comments

@ktuite
Copy link
Member

ktuite commented Nov 14, 2022

We're going to use a nested transaction inside the entity worker so that we can rely on the database constraints to flag any errors about entity creation. The "current" (before this issue gets fixed) version of the entity worker does some weird stuff like has a complicated pre-check query to test if the entity can successfully be inserted. We'll be able to do away with that extra query with this new approach.

We also need to clearly handle each of the possible submission processing outcomes:

  1. it could return null (the submission doesn't create an entity)
  2. it could successfully create an entity and return it
  3. there could be a validation error
  4. there could be a database constraint error
    a. there could be an error that comes from attempting to reprocess a submission that has already been processed, and we could do this with a db constraint or with some other pre-check
  5. there could be a validation error that comes from the fact that we're trying to process an encrypted submission (see more Verify that encryption + entities doesn't break things #668)
  6. there could be some other kind of internal error, e.g. a database connection problem, that is a kind of error we'd like to have the worker retry
@ktuite ktuite added this to the Entities for v2022.3 release milestone Nov 14, 2022
@ktuite ktuite added the entities Multiple Encounter workflows label Nov 14, 2022
@ktuite ktuite self-assigned this Nov 15, 2022
ktuite added a commit that referenced this issue Nov 18, 2022
* fix: cleaning up code for entity worker with nested db transaction

* Catch errors more generically
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entities Multiple Encounter workflows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant