hoodiehq / hoodie-client

:dog: Client API for the Hoodie server
Apache License 2.0
34 stars 25 forks source link

after reconnecting, store does not resume sync #133

Open gr2m opened 7 years ago

gr2m commented 7 years ago

The problem is in this line: https://github.com/hoodiehq/hoodie-client/blob/master/lib/init.js#L72

The event is not called connect but reconnect, see https://github.com/hoodiehq/hoodie-connection-status#events

Alice-anjali commented 7 years ago

Hi I went through the code as well as the APIs of this issue. As you mentioned above that the event is not called 'connect' but 'reconnect' and there are only 3 events declared in the hoodie-connection-status which are 'disconnect, reconnect and reset'. There is no event named 'connect'. So I guess if we just change 'connect' to 'reconnect', would it solve the issue ?

gr2m commented 7 years ago

@Alice-anjali yes, I think so. It might break some tests so these will need to be fixed, too. And if the change does not break any tests, then we should probably add a test for it :) Do you want to give a try?

Alice-anjali commented 7 years ago

Yes I would definitely give it a try! ^_^

Alice-anjali commented 7 years ago

I changed 'connect' to 'reconnect' and checked it. There are no tests breaking. @sohini-roy is already writing related test cases in the coverage issue. So, can I make a PR for this?

gr2m commented 7 years ago

can I make a PR for this?

Yes, please :) If you run into any blockers with the tests, let’s discuss there

Alice-anjali commented 7 years ago

I made a PR, please review it. :-)