Hello. Can someone tell me why the uuids of the applications are the same? Shouldn’t they be completely unique? If not, what does it depend on?
Hi @soeungi ,
If you want to use some form of unique ID, you can use ID in kobotoolbox, it seems there is an ongoing problem with UUID, there are open github issues for this problem:
opened 04:05PM - 17 Jul 18 UTC
bug
Example user:
https://app.intercom.io/a/apps/s6hn3a8q/inbox/inbox/conversati… on/16985968453
Discussion
https://www.flowdock.com/app/kobotoolbox/kobo/threads/g4mOr7lnWnyaLbdAa9WBAky5riO
And this one:
opened 10:44PM - 16 Jun 23 UTC
bug
offline-only
needs discussion
**Describe the bug**
If someone opens the same form more than once within the s… ame browser session, and then loads the same draft in multiple tabs or windows, the submissions created from those drafts will have the same UUID.
**To Reproduce**
No special form is needed. I tested with a single `decimal` question.
1. Open an offline-capable form
1. Enter a response in a field and then click outside the field to change the focus
1. This triggers saving an automatic draft (`autosave successful` in the console)
1. Open the same offline-capable form in a new tab
1. When prompted with "Unsaved Record Found", click "Load Record"
1. Go back to the first tab and click submit
1. Go the second tab and click submit
* You can make edits to responses here before submitting and also reach the same outcome
1. Result: two separate submissions with the same UUID are sent. This can be seen inside Enketo's IndexedDB `properties`, by looking at the `submitted` array within `<survey ID>:stats`
**Expected behavior**
The two submissions would have unique UUIDs.
**Screenshots**
![image](https://github.com/enketo/enketo-express/assets/2085013/9af17842-e217-4510-9798-c8f399618f48)
**Browser and OS (please complete the following information):**
- OS: Linux, Windows, Android
- Browser: Chrome, Firefox
**Additional context**
The same is true for named drafts (created with the "Save Draft") button as well as autosaved drafts.
I identified this code path for UUID generation:
1. Initial page load in offline-capable mode:
1. https://github.com/enketo/enketo-express/blob/6.1.0/public/js/src/enketo-webform.js#L29-L40
1. https://github.com/enketo/enketo-express/blob/6.1.0/public/js/src/enketo-webform.js#L239-L250
1. Form initialization:
1. https://github.com/enketo/enketo-express/blob/6.1.0/public/js/src/module/controller-webform.js#L105
1. https://github.com/enketo/enketo-core/blob/7.2.3/src/js/form.js#L332
1. Generation of UUID (only if none has been set already):
1. https://github.com/enketo/enketo-core/blob/7.2.3/src/js/preload.js#L170-L179
For loading a (named) draft:
1. https://github.com/enketo/enketo-express/blob/6.1.0/public/js/src/module/controller-webform.js#L808-L814
2. https://github.com/enketo/enketo-express/blob/6.1.0/public/js/src/module/controller-webform.js#L270-L307
3. Then proceeds with "Form initialization" as listed above, which will *not* regenerate the UUID
2 Likes
wroos
October 24, 2023, 9:51am
3
Could this be treated with higher priotity, please?
And it is a known bug/problem since some years already.
1 Like
@soeungi , did you clone your project (data) or manually upload your data to the server?
soeungi:
All data was downloaded manually. I already realized that this is an old problem. I have several questionnaires and none of them have had problems like this before, and now only one of them has this problem. Therefore, I thought that perhaps the problem was specifically in my kobo form.
All data was downloaded manually. I already realized that this is an old problem. I have several questionnaires and none of them have had problems like this before, and now only one of them has this problem. Therefore, I thought that perhaps the problem was specifically in my kobo form.