Daxbot / entangld

Synchronized key-value stores with RPCs and pub/sub events.
https://www.npmjs.com/package/entangld
MIT License
0 stars 1 forks source link

ensure transmitted "event" type messages only trigger correct callback #7

Closed jonathanvanschenck closed 3 years ago

jonathanvanschenck commented 3 years ago

This addresses the bug in Issue #6. It takes the approach of ensuring both callbacks only get called once. Additionally, it adds a test to test/events.js to check this functionality over remote datastores.

jonathanvanschenck commented 3 years ago

As a note, the main change is to have the "event" entangled receive handler check uuids (rather than just paths) before triggering the callback. This is more consistent with the behavior of the ._unsubscribe method, rather than the .unsubscribe method.