<div dir="ltr">+1 on using the event emitter. It should be the default implementation for the js sync client library.<div><br></div><div>I also think this should be fixed inside the sync framework itself. </div><div><br></div><div>For the js client, one options is that we could init an event emitter for each dataset. Then the event emitter can be used to manage the events for the bound dataset. I think no changes to the sync API required to support this.<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 23, 2017 at 10:02 AM, Wojciech Trocki <span dir="ltr"><<a href="mailto:wtrocki@redhat.com" target="_blank">wtrocki@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Michael <div><br>There are two side effects in Feedhenry sync that are important for your cases.<br><br></div><div>1) Line that was forwarded to us is responsible for triggering notification.</div><div>If you have specific notification then global notification will not be triggered.</div><div><br></div><div><a href="https://github.com/feedhenry/fh-sync-js/blob/6392b02813b09e252b1e7537249ce50dd8f5e5cb/src/sync-client.js#L360" target="_blank">https://github.com/feedhenry/<wbr>fh-sync-js/blob/<wbr>6392b02813b09e252b1e7537249ce5<wbr>0dd8f5e5cb/src/sync-client.js#<wbr>L360</a><br></div><div><br></div><div>IMHO both should be triggered as this is how most of the event implementation works.</div><div>This is trivial fix, but it may cause some backwards compatibility problems.</div><div><br></div><div>2) When you register notifications for specific datasets previous notifier will be removed<br><a href="https://github.com/feedhenry/fh-sync-js/blob/6392b02813b09e252b1e7537249ce50dd8f5e5cb/src/sync-client.js#L118" target="_blank">https://github.com/feedhenry/<wbr>fh-sync-js/blob/<wbr>6392b02813b09e252b1e7537249ce5<wbr>0dd8f5e5cb/src/sync-client.js#<wbr>L118</a><br><br>IMHO this may relay on something like event emitter, but that will require a lots of changes in the library.</div><div><b><br></b></div><div><b>With that in mind - we cannot have more than 1 notification handler per dataset</b></div><div>RainCatcher team can provide wrapper for that method in RainCatcher that will allow us to notify more than one listener per dataset.</div><div><br></div><div>Sending to feedhenry-dev for other opinions, before executing any actions. </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 20, 2017 at 6:07 PM, Michael Hearne <span dir="ltr"><<a href="mailto:mhearne@redhat.com" target="_blank">mhearne@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="font-size:12.8px;margin:1.2em 0px">There is a bug in sync where we cannot subscribe to events more than once at a time. The following fails:</p><pre style="white-space:pre-wrap;font-size:1em;font-family:Consolas,Inconsolata,Courier,monospace;line-height:1.2em;margin-top:1.2em;margin-bottom:1.2em"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;background-color:rgb(248,248,248);overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block">workorderService.subscribeToDa<wbr>tasetUpdates(() => {
    ...
  });
</code></pre><p style="font-size:12.8px;margin:1.2em 0px"><a href="https://github.com/feedhenry/fh-sync-js/blob/6392b02813b09e252b1e7537249ce50dd8f5e5cb/src/sync-client.js#L360-L361" target="_blank">https://github.com/feedhenry/f<wbr>h-sync-js/blob/6392b02813b09e2<wbr>52b1e7537249ce50dd8f5e5cb/src/<wbr>sync-client.js#L360-L361</a></p><span class="m_-2895447853477084941HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-2895447853477084941m_1171280822272949285gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><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;text-transform:uppercase"><font size="2"><span>MICHAEL</span> <span>HEARNE</span></font></p><p style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px;margin:0px 0px 4px;text-transform:uppercase"><span>MOBILE CONSULTANT</span></p><p style="font-family:overpass,sans-serif;margin:0px;color:rgb(153,153,153)"></p><p style="font-family:overpass,sans-serif;margin:0px 0px 6px;color:rgb(153,153,153)"><font size="2"><span style="margin:0px;padding:0px"><a href="mailto:mhearne@redhat.com" style="color:rgb(0,136,206);margin:0px;text-decoration:none" target="_blank">mhearne@redhat.com</a></span></font></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/files/brand/email/sig-redhat.png" width="90" height="auto"></a></td></tr></tbody></table><div style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px"><div style="color:rgb(153,153,153)"><a href="https://twitter.com/mickhearne" title="twitter" style="background-image:url("https://www.redhat.com/files/brand/email/sm-twitter.png");height:20px;text-decoration:none;color:rgb(119,119,119);display:inline-block;line-height:20px;padding-left:16px;background-repeat:no-repeat;background-position:0px 50%" target="_blank">@m</a>ickhearne  |  IM: #mhearne</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Feedhenry-raincatcher mailing list<br>
<a href="mailto:Feedhenry-raincatcher@redhat.com" target="_blank">Feedhenry-raincatcher@redhat.c<wbr>om</a><br>
<a href="https://www.redhat.com/mailman/listinfo/feedhenry-raincatcher" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/feedhenry-raincatche<wbr>r</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-2895447853477084941gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><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>WOJCIECH</span> <span>TROCKI</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;text-decoration:none" target="_blank">Red Hat <span>Mobile</span></a></p><p style="font-family:overpass,sans-serif;margin:0px 0px 6px;font-size:10px;color:rgb(153,153,153)"><span>IM: <span>wtrocki</span></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/files/brand/email/sig-redhat.png" width="90" height="auto"></a></td></tr></tbody></table></div></div></div></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
feedhenry-dev mailing list<br>
<a href="mailto:feedhenry-dev@redhat.com">feedhenry-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/feedhenry-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/feedhenry-dev</a><br>
<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"><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>WEI</span> <span>LI</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>SENIOR SOFTWARE ENGINEER</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>Mobile</span></a></p><p style="font-family:overpass,sans-serif;margin:0px 0px 6px;font-size:10px;color:rgb(153,153,153)"><span style="margin:0px;padding:0px"><a href="mailto:weil@redhat.com" style="color:rgb(0,136,206);margin:0px" target="_blank">weil@redhat.com</a>   </span> <span>M: <a href="tel:+353862393272" style="color:rgb(0,136,206);font-size:11px;margin:0px" target="_blank">+353862393272</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/files/brand/email/sig-redhat.png" width="90" height="auto"></a></td></tr></tbody></table></div></div></div></div>
</div></div></div>