This may be an “obvious” question, but I’m just trying to confirm observed behavior here… Let us say that we have a server-side action that takes several LISTS of things as inputs. For example, we might have Data Source 1 and Data Source 2, both specified as lists of some app type.
This server-side action will allow the Bubble programmer to specify the sources for both of these lists as searches, e.g., Data Source 1 is “Do a Search for Foos, with no constraints” and Data Source 2 is "Do a Search for Foos, with constraint field Bar (a boolean) is “yes”.
When used in an on-page workflow, the following seems to be true:
The presence of these Searches in the inputs of the plug-in does not cause those searches to be run in the page.
When that workflow (however it may be triggered) is triggered, those Searches are not executed in the page. (And, thus, no data of type Foo is downloaded to the browser – which is good.)
It would seem that the Searches specified as inputs to Data Source 1 and Data Source 2 are only executed on the server… But when?
Now, what I’m wondering is the following:
Are both searches always executed as part of instantiating the code for the server-side action?
Since the results of these searches become properties.data_source_1 and properties.data_source_2, does that imply that both searches are conducted before the plug_in code for run_server begins running?
… OR is there an optimization here such that the searches are only conducted if the executed code requires evaluation of either properties.data_source_1 or properties.data_source_2?
… Let us say that the code does some calculation and – depending upon the results of that calculation – conditionally branches in such a way that only one of properties.data_source_1 OR properties.data_source_2 is ever evaluated.
In that case, is the “other” search never executed? Or were both executed on our way into run_server?
@marca? Anybody done any mad science experiments to examine this?