This feature request is for the addition of a Server Connect (back-end) Break step. This would allow to break out of While or Repeat loops on-demand.
Meanwhile, users can use this workaround:
This feature request is for the addition of a Server Connect (back-end) Break step. This would allow to break out of While or Repeat loops on-demand.
Meanwhile, users can use this workaround:
Bump.
bump
Bump.
Bump.
Did this not get added in v6.7.3?
I've not used it yet so might be incorrect.
EDIT: I've just looked closer and I don't this is was added. The new features will stop the whole script, not just break out of the loop. Sorry.
You we now also have a throw error step which is much more convenient and clear.
You can add a try catch anywhere you want to conceal and just throw an error inside. That will essentially break out to the catch step.
Its a valid workaround, but not an elegant solution.
Requires three steps and nesting to do something that can be done with a single BREAK step.
Hence I still see a use case for a new BREAK action, to cleanly break while/repeat loops.
In sequential code you can do a simple break, but within an async promise chain it is not that simple.
The only way to break out of a promise chain is by rejecting it. I found a script that does that: GitHub - sindresorhus/p-break: Break out of a promise chain. This solution could not be implemented because it doesn't allow any other catch between the break and the catch break end.
If we would implement it then it would probably be an error that will be thrown and we have to rewrite a lot of our current error handling to make it let the break error pass through. You don't want some try/catch inside your loop want to prevent the break.
I have never thought about how a Server Action is executed, nor read about it in community.
I did not realize it would be this complicated, but what you say, does make sense to some extent.
Maybe you can think of some other way to goto the next step outside the loop step. Please let this FR be open for now.