Skip to content

Commit

Permalink
data store: avoid possible race condition with reloaded deltas
Browse files Browse the repository at this point in the history
* The cylc-ui typically opens two subscriptions:
  * One for all workflows (powers the workflows list down the left)
  * One for the workflow you have open (powers the Cylc views)
* This is for performance reasons as when the user switches workflow we
  only cancel latter subscription which avoids reloading all workflows.
* Because the reloaded delta would come through on both subscriptions
  there's the risk we could wipe the workflow's children, then
  re-populate them, only to wipe them again when the former subscription
  returned the reloaded delta.
  • Loading branch information
oliver-sanders committed Sep 21, 2023
1 parent 86122aa commit 38c86b5
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/graphql/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ const WORKFLOW_DATA_FRAGMENT = `
fragment WorkflowData on Workflow {
id
reloaded
status
statusMsg
owner
host
port
stateTotals
latestStateTasks(states: [
"failed",
"preparing",
"submit-failed",
"submitted",
"running"
])
}
`

Expand Down Expand Up @@ -152,7 +139,22 @@ fragment UpdatedDelta on Updated {
}
}
${WORKFLOW_DATA_FRAGMENT}
fragment WorkflowData on Workflow {
id
status
statusMsg
owner
host
port
stateTotals
latestStateTasks(states: [
"failed",
"preparing",
"submit-failed",
"submitted",
"running"
])
}
`

/**
Expand Down

0 comments on commit 38c86b5

Please sign in to comment.