Data store: flow numbers reported do not update to match reality
Description
Once a task is added to the data store with particular flow numbers, these do not update when the task actually runs with different flow numbers
Reproducible Example
[scheduler]
allow implicit tasks = True
[[events]]
startup handlers = cylc trigger %(workflow)s//2/a --flow=2 && cylc hold %(workflow)s//2/a
[scheduling]
cycling mode = integer
runahead limit = P0
[[graph]]
P1 = c[-P1] => a => b => c
[runtime]
[[root]]
script = sleep 5
cylc play <workflow-id> --pause
Using my branch to display flow nums in the UI tree view:
(Greyed out flow numbers are for "ghost tasks" that are not yet in the pool)
Expected Behaviour
1/c should be reported as flows=1 when it starts running. It is instead reported as flows=2 because the ghost task created by the data store was based off 2/a which was triggered in flow 2.
2/a should be reported as flows=1,2 when released, as flow merge has occurred from flow 1 catching up with flow 2. It instead continues to be reported as flow 2.
I have a branch (see https://github.com/cylc/cylc-flow/commit/f8cf9bfb76ccc282c02b16c6f50896f0b5b5652e) that attempts to fix this, however the fix results in traceback causing functional tests to fail which I don't understand.
E.g. tests/f/spawn-on-demand/06-stop-flow-2.t