duplicated invalidate sent in very close time, how to maintain the order #8491
Replies: 1 comment 1 reply
-
|
A good idea is to only invalidate in The check for This way, when you have concurrent mutations, you will ensure that only one invalidation runs at the very end of the chain, and you avoid those in-between invalidations that you likely don’t want. And if another mutation starts after the last mutation triggered an invalidation, the cancelation in Note that I’m also returning the result of the query invalidation. This makes sure that the mutation stays in pending state while the invalidation is still going on. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a sheet app optimistic updating value in "cell" by the following function, it will:
cellatpositionof functiontable.getCells({ tableId })table.getCells({ tableId })Now, let's say the network is pretty slow and we have 4 mutation requests (mutate the cell at position: col = 1, row = 0) in order:
mutation #91)mutation #92)mutation #93)mutation #94)I EXPECT to always see

1234at the cell finally. But I saw12at the end in very slow network environment. Here is the log:I believe the reason that seeing
12not1234at the end is somehowquery #73with the cell value12is the last response among all queries?Could anyone tell me how to solve this problem (always return the last mutated value like
1234)Btw, the last value in database is
12not1234Beta Was this translation helpful? Give feedback.
All reactions