Skip to content
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

What to do when local edits exist on a conflicted file which is remotely resolved #756

Open
meejah opened this issue Jun 22, 2024 · 0 comments

Comments

@meejah
Copy link
Collaborator

meejah commented Jun 22, 2024

A scenario was described during development of "resolve conflicts" PR #725:

  • the _local_update signal of the MagicFile state-machine goes from _conflicted -> _conflicted without doing anything
  • should we queue a LocalSnapshot, or is the user editing the file to ultimately resolve the conflict?
  • what if a remote party resolves the file meantime, and so we get an incoming update that is also a resolution?
  • (Could immediately re-conflict with the contents of the local edit -- that is, have a LocalSnapshot ready to go, apply the remote resolve but then produce a new conflict (hang on, we can't "produce a conflict" -- the other side has generated their new version) -- so yeah if we produce a LocalSnapshot at this moment, we could ensure its parent is our version before the incoming resolve (makes sense) and thus this is seen as a conflict by all parties)

That last thing might be the most-correct. That is:

  • continue to do nothing when we're conflicted and see a local change
  • _if_we get an incoming resolve while conflicted AND we have changed local contents, then:
    • queue a LocalSnapshot (with our current latest version as the parent, not the incoming resolve)
    • produce a new conflict locally (preserve "our" contents, write the resolution into conflict-marker
    • when our snapshot is uploaded, all other participants will see this as a conflict (I think?? right?)
  • ...maybe the user completes editing the file and deletes the conflict-markers before any incoming resolution appears; this means we just create our own conflict-resolution Snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant