offix icon indicating copy to clipboard operation
offix copied to clipboard

How to update query results in state

Open Eunovo opened this issue 5 years ago • 2 comments

Currently, our default update event handler for subscribeToMore in our query hooks apply updates from update events to all query results in state. The handler uses the document's primary key to find its updates.

How should we handle updates that cause the document in query result state to fall outside the query search parameters?

Options

  • Allow the result to remain in the state which we currently support.
  • Remove documents from the state as soon as they fall outside search parameters

What is the impact of these two?

We could also allow the user to choose which option to use.

cc @wtrocki @kingsleyzissou

Eunovo avatar Aug 24 '20 10:08 Eunovo

The handler uses the document's primary key to find its updates.

That is the key problem (as also primary key changes). We should stop using primary key can filtering individual changes

wtrocki avatar Sep 04 '20 11:09 wtrocki

Also this will help to avoid unneded complexity like ID_SWAP event type etc.

wtrocki avatar Sep 04 '20 11:09 wtrocki