Which 2 conditions?
The 2 conditions in the loop:
angular.forEach(metric.variantInformations, function (variantMetric) { metric.totalReceivers += variantMetric.receivers; if (
!variantMetric.deliveryStatus) { metric.deliveryFailed = true; } if (
variantMetric.servedBatches === variantMetric.totalBatches) { metric.servedVariants += 1; }
If there's a failure and deliveryFailed is set to true, there should be no need of increasing servedVariants counter, I think this is not robust code.
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.
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev