Conversation
| for (let i = node.ancestors?.length ?? 0; i > 0; i--) { | ||
| const { name } = node.ancestors[i - 1] | ||
| ret.push([ | ||
| 'family', | ||
| ancestor.name, | ||
| lastTokens.clone({ task: ancestor.name }) | ||
| name, | ||
| lastTokens.clone({ task: name }) | ||
| ]) | ||
| } |
There was a problem hiding this comment.
Hmmm, this suggests that we are receiving an added delta for the family, in which ancestors is undefined? If so, we have a data store bug :(
Note, this is also relevant to the graph view which needs to request the family hierarchy.
By this logic:
- If
ancestorsisundefinedon the first delta we receive, then we won't create the families under the cycle point. - If
ancestorsis defined on a subsequent delta, that won't trigger this to subsequently run (because the node already exists in the store).
This will certainly give us a partial tree at first, but I'm not sure if something else in the store will subsequently force these nodes to be created on future deltas, so the issue might get fixed in time.
There was a problem hiding this comment.
I don't think there are any ancestors that are actually missing in the data. I've captured this in the wild running with the site default stock UI server. The delta in question seems to be an updated delta:
{
"id": "3",
"type": "data",
"payload": {
"data": {
"deltas": {
"added": {
"familyProxies": [],
"taskProxies": [],
"jobs": []
},
"updated": {
"workflow": { "id": "~user/wflow" },
"familyProxies": [
{
"id": "~user/wflow//1/root",
"state": "running",
"childTasks": [
{ "id": "~user/wflow//1/one" },
{ "id": "~user/wflow//1/foo" },
...
]
}
],
"taskProxies": [...],
"jobs": [...]
},
"pruned": {
"familyProxies": [],
"taskProxies": [],
"jobs": []
},
"id": "~user/wflow"
}
}
}
}There was a problem hiding this comment.
What is missing is an added delta containing the familyProxies before the the updated delta
There was a problem hiding this comment.
Right, so this fix would disable the logic which populates these entries then?
(the logic only kicks in when a node is created, not when it is updated?)
There was a problem hiding this comment.
Looks like the logic kicks in if an update is received but the family proxy is not yet in the index (as is the case with the delta above)
cylc-ui/src/store/workflows.module.js
Lines 348 to 359 in cb0d052
Sounds like this situation of missing an added delta is a cylc-flow/cylc-uiserver bug. In the meantime, is this UI fix good to go for 2.12.0?
There was a problem hiding this comment.
(corrected understanding of the problem)
- There was no added delta for the FamilyProxy.
- Only an updated delta which did not have
ancestorsdefined (which is reasonable for an updated delta).
Does this mean:
- The added delta just never got sent, something was lost in translation (family should be added to the store).
- The family was created and pruned, but an updated delta slipped through the net (family should not be added to the store).
?
There was a problem hiding this comment.
(Discussed in person after some digging, summarising here for the record)
Does this mean: The added delta just never got sent, something was lost in translation (family should be added to the store).
Yes, that. Possibly fixed by cylc/cylc-uiserver#761
N.B. updated deltas for root families will never have ancestors as we have updated(stripNull = true) in the tree view subscription.
Btw, this PR will also defend against the bug if stripNull is ever turned on for added deltas
There was a problem hiding this comment.
Yes, that. Possibly fixed by cylc/cylc-uiserver#761
Hard to confirm this intermittent bug I appreciate, it sounds like this issue may have been fixed, do we think we still need this?
Btw, this PR will also defend against the bug if stripNull is ever turned on for added deltas
The stripNull option only makes sense in the context of updated deltas (shouldn't be an option for added) so we don't need to be robust against this (note the stripNull = false default is enforced by subscription merging so can't be done by accident).
There was a problem hiding this comment.
Don't know if it has been fixed by cylc/cylc-uiserver#761, and I don't think this PR will do any harm even if it has already been fixed. I've asked David Sutherland if he has any insight - cylc/cylc-uiserver#767
There was a problem hiding this comment.
This PR is skipping some logic in an event which (by contract) should not be possible.
So I would be keen to avoid this workaround if possible (not 100% convinced on the won't do harm bit).
|
Just experienced this in the wild again unfortunately |
Closes #1922
Guard against
node.ancestorsbeingundefinedrather than an empty array.Check List
CONTRIBUTING.mdand added my name as a Code Contributor.