Getting random error when clicking fast in Mendix app

0
Hi guys,I’m facing a weird issue in my Mendix app. Everything works fine normally, but when I click quickly multiple times on some buttons, I get this popup:“An error occurred, please contact your system administrator.”In the console, I can see something like: Failed to execute 'createObjectURL' on 'URL' It’s coming from a nanoflow action (downloadBadgeAction).The strange part is — this doesn’t happen always. Only when I click very fast or multiple times continuously. If I use the app normally, it works perfectly fine.Not sure if this is happening because the action is getting triggered multiple times in parallel or something is not ready yet when clicked again.Has anyone faced something similar?Any help would be appreciated! Thanks !
asked
1 answers
0

Hi Reemali,


This points to a race condition, not a platform issue. When you click fast, the action runs in parallel and one call reaches it with invalid/not-ready data (e.g. undefined or incomplete response), causing the error.


What I would recommend is to prevent repeated clicks while the first download is still running. In practice, disable the button, show a progress state, or use a Boolean flag like IsDownloading so the nanoflow exits immediately on a second click. That is usually the cleanest fix for this kind of issue. Mendix’s JavaScript action model supports async execution, so guarding against re-entry on the nanoflow side is important here.


If this resolves your issue, you can mark it as accepted.


answered