Submission is incomplete when inserting larger photos

Hi Kobo-Team!
My issue seems to be related to enketo express.

I’ve set up a form with the latest kobo-docker (Updated all docker images this week). The form has about 40 questions, some of them are image-fields. Depending on other answers, the image-fields are skipped. If they are displayed, they are mandatory

One answer is a repeated-group, where users can upload 0 or more “additional images”.

The form can be filled out without seeing any mandatory image fields, usually we have 4 images and no “additional images”.

When testing with desktop-browsers and mobile devices connected via WiFi everything was fine.
Now we rolled out the app to our users and experience large problems.

  • When submitting more than one image and these images are rather large, the form is sent to the server and all (text) data is present. The image names are part of the record, but some of the images are missing (looking inside the attachments-folder on the hard disk, only the first images are there the last ones are missing). On a Galaxy Note 1 we have some submissions with 7MB of images working, in other submissions only 4MB arrived on the server. On an iPad 2 the Limit seems to be 5MB. Here we can reproduce clearly, that the submission only contains those images that “fit” into 5MB.

  • When hitting the “send”-Button some users report an error “duplicate ID”

  • When hitting the “send”-Button some users report an error “invalid data”

Our users are driving to different locations (in germany) with their smart phones always on using mobile data. So we have varying connection speeds between “offline” and 50MBit LTE.

I tried to investigate a little further: A transmission of one single image is aborted after exactly 5minutes. I read a lot of explanation of enketo express, which says, that the upload is chunked. This does not seem to be the case in our setup. A submission with a phone with a throttled bandwidth but constant internet connection retries the upload, but never finishes.

So I raised the “timeout” from 5 minutes to 50 minutes (added values in enketo_express/config.json). Now even the larger files are uploaded with a slow connection. I thought I was done with it but on the next day the users in the field still experience the same problems!

Now we told the users to reduce their camera resolution. The images are now <1MB, the form data does not exceed 3MB. Everything works perfectly!

But some of the new users have really modern phones with terapixel cameras. They told me they cannot reduce the resolution that far.

As enketo express uses indexedDB for offline storage there should be not limitation on submitted or queued records. But it feeled like the varying limits of localStorage are active here.

Do you have any clue what can be done to ensure all images are submitted?
Do you have any workaround in mind?

(At the moment some users take the photos directly with the camera app and resize them with another app. When filling out the form they select those images. Others users just send me all their images at the end of the day and I edit all of their submissions from my desktop afterwards)

The system is a dedicated server (Ubuntu 16.04.2 LTS) with 2 cpu cores, 6GB RAM and more than 30GB of free SSD Storage. the kobo-docker containers are the only active applications on this server.

We use the docker-compose.server.yml setup with valid SSL-Certificates (LetsEnrypt)