Fix method calls during reconnect - #5104
Conversation
|
Hi @OleksandrChekhovskyi! I think you've correctly identified a real and serious bug, and written a good fix and great test. But I don't think your fix has the ideal semantics. Helpfully, I can point exactly to where it differs from what I think it should do in your test! When a stub writes to a document, we're supposed to continue to see the stub value until the method returns. So I think your addition of Maybe to make your test more complete you could (a) add an assertion that the value becomes 222 as soon as the |
93a6509 to
ccffa3f
Compare
|
I've updated the patch to ensure that stub-written values survive reset. |
User could enter irrecoverable broken state after doing any action while reconnecting (specifically between stream reset and quiescence). In this state some or all documents in collections would be missing, because the loop processing buffered messages is interrupted with an exception in _process_added. This commonly happened on slow/bad networks, such as mobile.
ccffa3f to
c6ea93f
Compare
There was a problem hiding this comment.
maybe even verify that this message isn't what changes it (though this isn't relevant to your fix)
|
OK, this looks good. I'm a little concerned about what happens if the method returns before the subs all get ready (ie, before quiescence) but that can be a later issue to fix... |
Fix method calls during reconnect
|
@OleksandrChekhovskyi, thank you for this PR! |
That should ideally be tested as well, but right now it's a pure theoretical concern, as in practice the method won't even be sent until quiescence (blocked by login wait method, injected from onReconnect callback). |
|
we're getting the error Hoping this PR will solve that issue. 👍 |
User could enter irrecoverable broken state after doing any action while
reconnecting (specifically between stream reset and quiescence).
In this state some or all documents in collections would be missing,
because the loop processing buffered messages is interrupted with an
exception in _process_added.
This commonly happened on slow/bad networks, such as mobile.