Users Using different browers to perform an Action Multiple times

I have a repeating Group of tasks. And each contains a button.
Each user have a field (Amount) and (Done tasks) a list
The Idea is to ensure that each user do not perform a Task more than once.

The Buttons in the RG Makes changes to current users (Amount )and (Adds the Task to Current users done task)

Hence, the RG is (Search for tasks: minus list Current Users Done Task) s- this keeps the list updated.

Example: When Button is clicked : Make changes to current user : Amount = Current users Amount + 1.

Users are using mutiple browsers to perform the action at once . I tested it myself u sing wo browsers and clicked the button at the same time and the problem was evident - adding +1 twice

Solutions I’ve tried:

  • When current cells task is in Current Users Done Task , Button isn’t clickable
  • When current cells task is in Current Users Done Task , Button isn’t Visible.

I can’t seem to stop this which is evident throught my app as users have spot the loophole with diffrent actions on the app using mutiple browsers.

Would appreciate some help.

Another route you can take is after user logs in use the action “Log out other user’s sessions” in your workflow under account. This will keep one user session.

1 Like

Thank you for your reply. I have tested it and this works when the browsers are open on different devices. However, it doesn’t work when multiple browers are open on the same device.

If the action does not have to be instant, you can move this to a backend workflow:

  • Add a log datatype with fields action ( type text) and running ( type yes/no).
  • When button is clicked, send this workflow to the backend with parameters action, list of tasks and set it to run now( current date/time)
  • In the backend, create a thing log with action “updateAmount” and running “yes”. With a only when condition do a search for log with a constraint running is “yes” count is 0.
  • The next step will be moving your existing workflows to the backend and running them on the parameter tasks. Add a only when condition step 1 created log’s unique id is not empty.
  • The last step is to set step 1’s created log’s running to “no”.
1 Like

Thanks for this detailed reply. The workflow currently runs in backend. Will try to do a workaround as this however, i am midgul of WU as each user might run this 20 to 30 times daily wit 5k users. Thanks again for your help.

Sorry if I’m missing something, but could you not just create a flag field (y/n) called “Is Running” or “In Progress” on the task row (the same task in the list of tasks in the repeating group), set the flag when the task is running, and then make the button inactive when the flag is yes?

@dialekt @will_ericksson Thank you both for your suggestions. I have implemented this. However, some users are still getting in between the cracks.
I have a button that lets user claim every 24hrs.
The button isn’t clickble by default.

claim: is a date stored everytime the button is clicked
R_Claim: is Y/N used to prevent the multiple claim issue.


WF - When button is clicked
-Make change to current users R_Claim to Y
-pause before the process
Both triggers end with setting R_Claim to N

Claim Success changes current users claim to current date and time
R_Claim is set back to N

User B Claimed 2 minuites apart
User A and C claimed hours apart
Not getting to 24 hrs. is there something i’m not doing right?


Thanks again

Check out this writeup by @ihsanzainal84

Bubble and Cloudflare for transactional updates - Tips - Bubble Forum

2 Likes

@olowusamson the issue “feels” related to timing (a race condition) where multiple users are trying to interact with / update the same data at a similar time.

I teach our students never to use the Pause workflow action to control data operations (create/read/update/delete). In using Pause, there is always the chance you introduce an unpredictable outcome (like this one). To make matters worse, the issue may only show up occasionally, making it virtually impossible to debug.

I’d only use a Pause in the case I’m trying to affect the user experience of one particular user, where a race condition is impossible.

For this particular scenario, it’s difficult to debug on the forum without a more detailed look at the problem, as it could be multiple things. We offer training/mentoring in our course, and there are lots of others who could jump on a call and work through it with you.

You’re right about the difficulty in debugging, over 1k users performed the action yesterday without any duplicate issues