Can I prevent infinite loops in formulae?

I’d like to sum all the story points on Task and their recursive child Tasks.

Occasionally people make loops in the parent chain (I’m slightly unsure how they are doing that, but they seem to - perhaps there’s a bug in the drag+drop hierarchical list editors that causes this?).

Is there any way to recover from this?
At the moment Fibery complains that there is a loop and then disables the formula. It would be nice if:

  • The error mentioned which entities this affects, so you can at least go and fix them and re-enable it.
  • Fibery didn’t let you do this in the first place.
    • Might I be able to achieve this with an automation somehow?
    • I suspect that even if I did, the formula would re-calculate and get disabled before the automation ran?

Or can I make a formula that somehow detects such loops and makes the calculation work regardless? (I would need to add the entities to a set as I went and check it, or something.)

1 Like

Yeah, we want to make this, and other errors, easier to debug. Not sure when we’ll work on it.

It’s actually quite hard to do performantly, since it would imply a potentially unlimited search through the relationship tree.

I can’t think of a way of solving this using the existing Fibery capabilities.
Maybe something will become possible if/when Fibery has a union function in formulas :thinking:

It’s certainly possible for some javascript to check for loops in linked entities, at least for a few thousand entities (memory and CPU will eventually be a limiting factor), but I’m not sure how/when you would want to run it.