-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync can unexpectedly occur with devices that have not enabled it #762
Comments
Took a quick look. There's a possibility that here: https://github.com/digidem/mapeo-core-next/blob/72709284c9f37a2559e28b80d0ebec5e7726af49/src/sync/peer-sync-controller.js#L266 whichever side closes first will result in the peer being removed from |
ah very interesting. so, i can confirm that there's different behavior based on who stopped sync first. It seems like whomever stops sync first is also the one who will cause the bug to occur when they re-enable sync. For example, after step 3 in the original description:
Does this align with what you'd suspect? |
Working on this now. See this work-in-progress branch, which currently just has a failing test and some TODOs. |
This change: - Fixes core unreplication, closing issue [#762]. - Adds "fuzz testing" for sync, which tries a bunch of random actions and makes sure things work as expected. [#762]: #762 Co-Authored-By: Gregor MacLennan <[email protected]>
Description
I'm running into a situation where I can get data sync to occur between two devices even though only one of them has data sync enabled. Using myself and Evan as an example, here are the reproduction steps:
The expectation here is that in 6, Andrew should be in some pending state, waiting for any other connected devices (in this case, Evan) to also enable sync. Instead, sync immediately happens without Evan opting in.
Important notes:
In step 1, not sure if it matters what role is chosen for Evan.
I've only tried this when Evan is a participant, but might be worth trying to reproduce the issue for when Evan is added as a coordinator.EDIT: being a coordinator did not make a difference.Steps 2,3, and 4 are important. If we do this without those steps, the issue does not seem to occur. In technical terms, it seems like a prior data sync has to have happened before encountering this issue.
In step 6, it's vital that Andrew enables sync again. If it were Evan that did that instead, this issue does not occur.
This suggests that something about being the project creator somehow bypasses the expected sync "etiquette".EDIT: This is probably wrong, see Sync can unexpectedly occur with devices that have not enabled it #762 (comment) for a more likely explanationGoing back to the first note, wondering if the issue could be reproduced if Evan were a coordinator and re-enabled sync instead of Andrew.EDIT: being a coordinator did not make a differenceTasks
The text was updated successfully, but these errors were encountered: