getodk / getodk/central

Editing an unencrypted submission to a form that is now encrypted

Open
#1,301 5 comments 0 reactions 0 assignees View on GitHub
frontend
Dominant language
JavaScript
Stars
226
Forks
235
Avg merge
2d 22h
Merged PRs (30d)
19

Description

This issue has to do with forms that were originally not encrypted but that became encrypted (for example, after the project is encrypted). If submissions were created for the form before it was encrypted, then the form may end up having a mix of newer encrypted submissions and older unencrypted submissions. Central Frontend does not allow encrypted submissions to be edited. However, it does allow unencrypted submissions to be edited, even for an encrypted form. That said, editing an unencrypted submission doesn't actually end up working:

- If the submission has an attachment, then when you try to submit the edit, Enketo shows an error message: "TypeError: Require Blob"
- If the submission does not have an attachment, then the edit can be submitted. However, it is not received as an edit of the existing unencrypted submission, but rather as a new encrypted submission.

QA tried the second case on a server running Central v1.2 and saw the same behavior, so that case seems to predate Central v1.3 and Enketo 3.0.

A few questions:

- Is Enketo supposed to be able to edit an unencrypted submission to a form that is now encrypted?
- If so, it seems like the TypeError is unexpected.
- If not, maybe Enketo could fail immediately, explaining that the case is not supported? We could then modify Central to not allow such edits.
- When a submission is edited, the latest form version is used. That usually seems like the right behavior. But what does that mean for editing an unencrypted submission to a form that is now encrypted? Is that possible within Central given how form versions and submission versions are currently set up?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.