mikemintz / react-rethinkdb

Render realtime RethinkDB results in React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use atomic changefeeds instead of extra non-realtime initial query

mikemintz opened this issue · comments

Now that RethinkDB 2.2 has been released with atomic changefeeds, we can make our changefeed logic much simpler and more robust. See the TODO notes in QueryState.js.

This will probably make react-rethinkdb incompatible with older versions of RethinkDB, at least for changefeed queries. But I consider that an acceptable tradeoff, given that this solves the possible race conditions we had.

We'll need to make sure we can fail fast on old versions of RethinkDB running in the backend. I haven't looked at the API for atomic changefeeds, but hopefully it's something that will be rejected by RethinkDB 2.1 as opposed to fulfilled incorrectly.

I created PR #21 with atomic changefeed functionality.

I'll test it thoroughly when rethinkdb 2.2 packages hit arch linux and npm, and probably upgrade rethinkdb-websocket-client first so we get the 2.2 driver too.