What I'm trying to simulate here is if one node loses all of it's data including document data as well as any previous sync state information.
The test i've created here goes into an infinite loop. I believe I'm experiencing this in a real world app but I'm not 100% sure I've captured it accurately in the test.
I'm wondering if this is something application developers should be proactive about (sending a sync message for a blank document) or if this is an actual bug in the sync protocol.
I am able to sync these docs when they both reset their sync state to initialSyncState(). So the question is how should the node that has intact state react to the "bad" sync request from the errant peer?
EDIT: I made the test pass but I'm not sure what kind of damage my "fix" may have caused. It seems reasonable that if the incoming message is saying "I have nothing" that the entire sync protocol should begin anew?
What I'm trying to simulate here is if one node loses all of it's data including document data as well as any previous sync state information.
The test i've created here goes into an infinite loop. I believe I'm experiencing this in a real world app but I'm not 100% sure I've captured it accurately in the test.
I'm wondering if this is something application developers should be proactive about (sending a sync message for a blank document) or if this is an actual bug in the sync protocol.
I am able to sync these docs when they both reset their sync state to
initialSyncState()
. So the question is how should the node that has intact state react to the "bad" sync request from the errant peer?EDIT: I made the test pass but I'm not sure what kind of damage my "fix" may have caused. It seems reasonable that if the incoming message is saying "I have nothing" that the entire sync protocol should begin anew?