<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​But I am asking for a clarification of this code, I cannot send a fix if I don&#39;t understand what this does.​</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 April 2017 at 14:29, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Mind sending a PR ? </div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Apr 20, 2017 at 1:31 PM, Jose Miguel Gallas Olmedo <span dir="ltr">&lt;<a href="mailto:jgallaso@redhat.com" target="_blank">jgallaso@redhat.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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" target="_blank">https://github.com/aerogear<wbr>/aerogear-unifiedpush-server/<wbr>blob/1.1.x-dev/admin-ui/app/<wbr>components/app-detail/include/<wbr>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" target="_blank">https://github.com/aerogear/ae<wbr>rogear-unifiedpush-server/blob<wbr>/1.1.x-dev/admin-ui/app/script<wbr>s/endpoints/metricsEndpoint.<wbr>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><span class="m_-349957153708970307HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-349957153708970307m_-1143870688228597913gmail_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>
</font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/aerogear-dev</a><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-349957153708970307gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.<wbr>wordpress.com/</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/aerogear-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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>