bitpay/copay — pull request #1214 by matiu (2014-08-27 22:03:48+00:00)
Title: Bug/join wallet

this is a working-around about a timing problem that happens randomly when joining a wallet.

Check this line:
https://github.com/matiu/copay/compare/bitpay:master...matiu:bug/join-wallet?expand=1#diff-faf82e7c0f3d66ca6fc559e0d6c05924R304

the `emit('subscribe')` and `emit('sync')` need to be called in sync, or insight throws an error.

An other way to solve this would be to emit an event from insight *after* the peer is subscribed to the room, and the call sync when that even arrives; or to add a param to sync to, to 'subscribe and sync'.

This error happened *always* on safari and ios browsers.

ping @maraoz and @matiaspando