Server delay when accessing newly created data?

Hello! I am working on an app, and there seems to be a weird issue happening that I can only imagine is a delay between the time a new piece of data is submitted and when it can be accessed via a search. The reason I suspect this is that when I run it normally, it does not behave as expected. However, when I run it step-by-step in the debugger without any changes, it behaves as expected.

Here is what I am doing:

  1. A form is submitted by user creating a new piece of data
  2. The workflow that the submit button triggers as expected, and at the end it triggers a custom workflow.
  3. The custom workflow does a search that should have this new piece of data included, but it doesn’t.

Is there a delay here or another obvious problem anyone can see? Any ideas how to fix?

You can never rely on creating something then searching for it later assuming it will find it. Instead you have to refer to the Result of the Create a thing step, so Bubble knows to wait for it.

Running the debugger step-by-step forces it (sometimes) to behave how you want but it doesn’t behave like it would in real time

That’s kind of what I figured. I tried adding a dummy and optional property to the custom workflow so I could add “results of step…” hoping that would force the custom workflow to wait until that step was finished. Still didn’t work, but I think I’ve found an alternative approach to the whole thing anyways.

1 Like