kadirahq / fast-render

Render you app even before the DDP connection is live. - magic?
MIT License
560 stars 80 forks source link

Fast-Render re-write feature tries to re-write `added` messages of non existing document #188

Open varenytskyi opened 7 years ago

varenytskyi commented 7 years ago

Issue:

There is still a case when fast-render re-writes added messages of previously removed documents. As result meteor throws the following error: fast-render example 2017-02-24 16-38-05

Here is an example app where you could try this out: https://github.com/varenytskyi/fast-render-example/tree/master or see this video

Mostly it happens when document is re-added with another cursor in complex publications


Fix:

The fix is pretty simple. Since meteor buffers ddp messages we have to be sure that there is no removed message in internal meteor queue before re-writing added message of the same document.

There is a branch with patched fast-render in the app I've mentioned above: https://github.com/varenytskyi/fast-render-example/tree/with-patched-fast-render Here is also a video how patched version works.

varenytskyi commented 7 years ago

Hi @arunoda,

This is a critical issue which appears even when initial loading is completed.

It would be great to see this issue patched. Thanks!

varenytskyi commented 7 years ago

@theosp No, I didn't. I clearly explain above what kind of issue this changes fix.

Nice to see your new PR as far as the issue you've mentioned appears as well sometimes :thumbsup: