Bug when editing submissions with many images in a repeat group (multi-batch issue)

Hi everyone,

I wanted to share an issue I’ve encountered and analyzed on KoboToolbox related to editing submissions to add multiple images in a repeat group.

:memo: Summary of the problem
If you create a form with a text field and a begin repeat containing image fields. Submit a empty form (or with some text in text field). Edit this new submission and adding many images (enough to exceed the 10MB limit), Enketo splits the data into multiple “batches” before sending it to the server.

The problem is that the first batch is accepted, but the following batches fail — the user gets a 400 error saying:

“The server did not accept the data. Please contact the survey administrator (400)”

:magnifying_glass_tilted_left: What I found
It seems that during editing, Enketo sends each batch to the KPI backend. The first batch updates the submission, but when the second batch is sent, KPI can no longer find the original instance (since it was already modified), and it throws an error.

This issue does not happen when making a new submission (even large ones), only when editing an existing one with new attachment adding in the edition.

:warning: I’m not sure if this is an issue with Enketo, KPI, or KoBoCat, but I’ve opened a GitHub issue, along with a temporary workaround we applied on our instance:

Link to the GitHub issue

I’d love to hear from the Kobo team or other community members:

  • Has anyone else experienced this?

Thanks in advance for your help!

Jonathan

1 Like

Welcome back to the community, @jdugh! Have you tried this outside the repeat group?

Hi @Kal_Lam, thank you !
Rigth now, following your advice to do this test, I have the same behavior/same error outside the repeat group (forms with only 4 simple photos questions) : Submit a blank form, edit it and add 4 photos on each photo question (~2.5Mo each photo).

1 Like

Thank you @jdugh, seems like you already have created a GitHub issue for this: