Fix sync propagation for mutating listener deletions#285
Conversation
Summarylistener** (for example, a listener that immediately deletes a row after receiving it). The root cause was twofold:
Result: all clients converge to the same final state, including cases where business logic mutates data during sync How did you test this change?I tested this with both a new regression test and targeted existing suites.
|
5e7d338 to
1a8666f
Compare
|
Incredible work. Thank you so so much. |
|
NB this is currently breaking test/unit/synchronizers/synchronizer-ws-server.test.ts but I can fix it |
|
aaaand I found a bunch of other problems (mine!) in this area. Hopefully all good now though! |
Summary
This change fixes a sync gap where mutations triggered by a mutating listener were not propagated back to peers. Incoming expected diffs and listener-generated local mutations are now handled separately and correctly. As a result, stores converge to the same final state
How did you test this change?
I reproduced the issue with two local synchronizer stores; before the fix they diverged, and after the fix they converged. I added a regression test for this scenario and ran targeted synchronizer tests (Local, BroadcastChannel, Custom). I also ran mergeable-store unit tests to confirm no regressions