mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

Resubscribe upon reconnection using the same id and same subscription object #103

Closed furkanmustafa closed 7 years ago

furkanmustafa commented 8 years ago

Basicly does what the title says.

I am not sure if this is as easily accaptable as the previous PR

Please let me know what do you think.

In our use case ( a custom ddp server, asteroid + vue.js on frontend ); This helped updating a desynced clients' data, without adding reconnection handling logic or anything to the application code.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.2%) to 98.758% when pulling 6f5e7b522a12b69329f86054373ff7e610b972f6 on the-shell-inc:master into abadf77f5aeb1c37d431d8f7afb2d65a1b1f988e on mondora:master.

furkanmustafa commented 8 years ago

I have fixed the behavior and tests. But, I did not yet understand the coverage issue.

Also, as I've mentioned, I'm not sure that you want this change yet. Waiting until further comments.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.2%) to 98.765% when pulling 569277ac31c9c41231d170f8cc1f282510cfe2e5 on the-shell-inc:master into abadf77f5aeb1c37d431d8f7afb2d65a1b1f988e on mondora:master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.2%) to 98.765% when pulling 1e10efd60c0490c914d71b4ef602835ca32f8d36 on the-shell-inc:master into abadf77f5aeb1c37d431d8f7afb2d65a1b1f988e on mondora:master.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 7c240985d5d0074212a236485e411917c81e460b on the-shell-inc:master into abadf77f5aeb1c37d431d8f7afb2d65a1b1f988e on mondora:master.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 8078ced3837edf07e00da785558f3745cf393403 on the-shell-inc:master into abadf77f5aeb1c37d431d8f7afb2d65a1b1f988e on mondora:master.

pscanf commented 8 years ago

Hi @furkanmustafa ,

Thanks for the PR and sorry for the delay. I haven't had time to review it yet. It's a bit complex, mainly because the re-subscription logic has always been very hairy and there were some of corner cases that needed to be handle with caution (I'll need to return on the code to remember them all).

In the meantime - or if the feature turns out to be too complex for the library - you could put your custom logic into a mixin so that you can use it in your application.

I'll keep you updated on the review :-) Cheers