Issue in API workflow on a list

Hello,
I am using the “Multifile uploader - Dropzone” plugin by Bubble. I have added the multifile uploader element to one of my pages. I have created a workflow using “An inputs value is changed” on the multifile uploader. Once this is triggered I schedule a API workflow on a list which runs on the list of files from the uploader. The API workflow creates an Attachment for each file, which is a custom datatype for storing the file and making it possible to add description and other fields later. The created Attachment is then added to a thing to a field which is a list of Attachments.

When I upload several files I see that both workflows are running as expected, the list of files from the uploader include all the files that I have added and that the API workflow creates Attachments for all files.

The issue I am experiencing is that only a subset of the created Attachments are added to the thing. I can see in the server logs that all Attachments are added, but when inspecting the database all Attachments are not there.

Below is an image of the API workflow, log images showing when I added 3 files to the uploader, database showing 3 Attachments created correctly and the final image is showing how only 2 of these appear in the thing where they are added.

Any advice on how to debug this further?






I have tried multiple workarounds to this issue. I have added retries in the API workflow to add the attachment to the thing with a condition that it will only be added if it’s not already there. I have split adding the attachment to the thing into a separate API workflow and even trying to schedule it to run a few seconds later. But for all cases I see that X number of files are uploaded, resulting in X Attachments being created, but only a subset of these actually being added to the thing.

There must be a bug in the Bubble platform.

I experience the same on all API workflows on a list. That feature as bugged.

There is only a solution to that: Manually add a Interval (seconds) > 1s, which creates a terrible customer experience in the front end.

In cases like this, instead of adding the newly created thing using “Restult of step 1…” and the “add” operator, I use “do a search for” to find all the newly created items and using “set list” to set the list to the output of the “do a search for” in every run. This seems to work much for reliably for me

If you run on a list with 100 items, you will pay for x100 searches to get the same result. It is prohibitive from WU cost perspective.

@julianno.09 It is never mentioned by the OP that the lists are large, for smaller lists the additional WU usage will hardly be noticeable. I would take that over the other option which increases loading times. However, the best solution would be if these race condition issues can be fixed by Bubble of course

Thank you for your suggestions. I tried implementing both.

Adding a time interval didn’t work for me. I see that the unique id of the object that I am adding to the list is being processed in the logs, but still not all of them appears in the database. And as you say, the user experience is terrible :slight_smile:

I also tried the “do a search for”. This works, however I afraid that I might run into some privacy issues in the future if I get multiple users uploading files at the same time.

I reverted into using single file uploader until bubble resolves this. Keep my fingers crossed that they will.