611
612
//nolint:revive,errcheck // In async mode the activities retry indefinitely so this function should not return error
613
>
func (d *VersionWorkflowRunner) deleteVersionFromTaskQueuesAsync(ctx workflow.Context) {
version_workflow.go
614
>
// If there are propagations in progress, we ask them to cancel and wait for them to do so.
615
>
// The reason is that the ongoing upsert propagation may overwrite the delete that we want to send here, unintentionally undoing it.
616
>
d.cancelPropagations = true
617
>
workflow.Await(ctx, func() bool { return d.asyncPropagationsInProgress == 1 }) // delete itself is counted as one
618
>
d.cancelPropagations = false // need to unset this in case the version is revived
619
>
620
>
d.deleteVersionFromTaskQueues(ctx, workflow.WithActivityOptions(ctx, propagationActivityOptions))
621
>
d.asyncPropagationsInProgress--
622
}
623