​I don't fully understand what's happening in this iteration and why there's no "else" clause. The problem is caused by this I think. During some iteration the counter is not being increased hence the servedVariants never equals totalVariants and hence (again) the label does not change.​

So the current flow would be:

1. If deliveryStatus is falsy, flag an error.

2. If servedBatches = totalBatches then increase servedVariants

Can both conditions pass? I think they can although this is not expected.

Can deliveryStatus be always truthy but the servedBatches != totalBatches? I think that what's happening and as a result, it is hiding some error that the user may want to see.

I also think that, in case of deliveryStatus, the iteration should stop.

​I don't fully understand what's happening in this iteration and why there's no "else" clause. The problem is caused by this I think. During some iteration the counter is not being increased hence the servedVariants never equals totalVariants and hence (again) the label does not change.​

So the current flow would be:

1. If deliveryStatus is falsy, flag an error.

2. If servedBatches = totalBatches then increase servedVariants

Can both conditions pass? I think they can although this is not expected.

Can deliveryStatus be always truthy but the servedBatches != totalBatches? I think that what's happening and as a result, it is hiding some error that the user may want to see.

I also think that, in case of deliveryStatus, the iteration should stop.

​I don't fully understand what's happening in this iteration and why there's no "else" clause. The problem is caused by this I think. During some iteration the counter is not being increased hence the servedVariants never equals totalVariants and hence (again) the label does not change.​

So the current flow would be:

1. If deliveryStatus is falsy, flag an error.

2. If servedBatches = totalBatches then increase servedVariants

Can both conditions pass? I think they can although this is not expected.

Can deliveryStatus be always truthy but the servedBatches != totalBatches? I think that what's happening and as a result, it is hiding some error that the user may want to see.

I also think that, in case of deliveryStatus, the iteration should stop.

​I don't fully understand what's happening in this iteration and why there's no "else" clause. The problem is caused by this I think. During some iteration the counter is not being increased hence the servedVariants never equals totalVariants and hence (again) the label does not change.​

So the current flow would be:

1. If deliveryStatus is falsy, flag an error.

2. If servedBatches = totalBatches then increase servedVariants

Can both conditions pass? I think they can although this is not expected.

with two conditions?

Can deliveryStatus be always truthy but the servedBatches != totalBatches?

Yes, each batch uses a Sender, which signals if it could submit something to the provider:

Then we should keep track of "unservedVariants" so we know when all variants have been processed (not served). Because if 1 variant has not been served and deliveryStatus is falsy, the label in the Activity Log will be permanently "Pending".

I'm not really suggesting anything in particular, just trying to understand this code. So please correct me if I'm wrong.

​I don't fully understand what's happening in this iteration and why there's no "else" clause. The problem is caused by this I think. During some iteration the counter is not being increased hence the servedVariants never equals totalVariants and hence (again) the label does not change.​

So the current flow would be:

1. If deliveryStatus is falsy, flag an error.

2. If servedBatches = totalBatches then increase servedVariants

Can both conditions pass? I think they can although this is not expected.

with two conditions?

Can deliveryStatus be always truthy but the servedBatches != totalBatches?

Yes, each batch uses a Sender, which signals if it could submit something to the provider: