<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi all,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I am trying to solve some bugish behaviour that makes the status label to be &quot;Pending...&quot; permanently, even when the notifications have been sent.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">The label is &quot;Pending...&quot; when &quot;<b>servedVariants</b>&quot; is less than &quot;<b>totalVariants</b>&quot; -&gt; <a href="https://github.com/aerogear/aerogear-unifiedpush-server/blob/1.1.x-dev/admin-ui/app/components/app-detail/include/activity.html#L46">https://github.com/aerogear/aerogear-unifiedpush-server/blob/1.1.x-dev/admin-ui/app/components/app-detail/include/activity.html#L46</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Well, in the <b>metricsEndpoint.js</b>, it iterates over all variants and flag an error or increase the &quot;<b>servedVariants</b>&quot; property -&gt; <a href="https://github.com/aerogear/aerogear-unifiedpush-server/blob/1.1.x-dev/admin-ui/app/scripts/endpoints/metricsEndpoint.js#L28-L30">https://github.com/aerogear/aerogear-unifiedpush-server/blob/1.1.x-dev/admin-ui/app/scripts/endpoints/metricsEndpoint.js#L28-L30</a></div><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​I don&#39;t fully understand what&#39;s happening in this iteration and why there&#39;s no &quot;else&quot; clause. The problem is caused by this I think. During some iteration the counter is not being increased hence the <b>servedVariants</b> never equals <b>totalVariants</b> and hence (again) the label does not change.​</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">So the current flow would be:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">1. If <b>deliveryStatus</b> is falsy, flag an error.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">2. If servedBatches = totalBatches then increase servedVariants</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Can both conditions pass? I think they can although this is not expected.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Can deliveryStatus be always truthy but the servedBatches != totalBatches? I think that what&#39;s happening and as a result, it is hiding some error that the user may want to see.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I also think that, in case of deliveryStatus, the iteration should stop.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">WDYT?</div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​Cheers,​</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:uppercase"><span>JOSE MIGUEL</span> <span>GALLAS OLMEDO</span></p><p style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px;margin:0px 0px 4px;text-transform:uppercase"><span>ASSOCIATE QE, mobile</span></p><p style="font-family:overpass,sans-serif;margin:0px;font-size:10px;color:rgb(153,153,153)"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat <span><br><br></span></a></p><p style="font-family:overpass,sans-serif;margin:0px 0px 6px;font-size:10px;color:rgb(153,153,153)"><span href="tel:+34618488633">M: <a href="http://redhatemailsignature-marketing.itos.redhat.com/" style="color:rgb(0,136,206);font-size:11px;margin:0px" target="_blank">+34618488633</a>    </span></p><table border="0" style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium"><tbody><tr><td width="100px"><a href="https://red.ht/sig" target="_blank"><img src="https://www.redhat.com/profiles/rh/themes/redhatdotcom/img/logo-red-hat-black.png" width="90" height="auto"></a></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div></div></div>
</div>