-
Notifications
You must be signed in to change notification settings - Fork 6
Sync: Merge conflict detection or handling #2
Comments
Sorry if you ran into this! It's a rough part of the app. The whole thing is pretty much a proof-of-concept at this point, but I'm working on refactoring in the
I think in the short term, solving these issues you've identified would give the user the necessary tools to fix the conflict:
The error could be displayed wiki-wide for any errors generated while syncing, so you'd at least know something happened. Could double for showing you network issues and whatnot, too. The conflict page could just show plaintext, or launch you right into the editor with a message printed above it. (Of course, multi-file conflicts might be a bigger problem...) In the longer term for merge conflicts, I've mostly been thinking about how to avoid them. At least, in common cases. Since this is a single player wiki, I've been planning to add two explicit sync points:
The idea with these two is that the user is probably bouncing between a few different computers running deadwiki, so submit any changes as soon as they make them and pull changes as soon as they begin a new "session." Beyond that, I was going to add the SHA to the edit But I am open to all ideas. I want to keep the act of creating and editing wiki pages extremely fast, so I don't want to put a |
Not to worry. I only encountered this because I was intentionally causing conflicts to see how it handled the situation. I've been bitten by other note taking apps that simply drop one set of changes/last writer wins. The only situation I'd imagine I would run into conflicts in the real world would be if I have an offline locally-running wiki, and I want to make some changes to it, but upstream has since updated. |
The offline scenario is a good one, I’ll make sure to test that out. I’m going to leave this open until it’s tackled. |
Okay, I've added the start of this: if your wiki page has git conflict syntax in it, you'll get dropped into the editor with a message: I think for the second part I'll add a |
I'm not asking for a fix for this issue, but more to start a conversation on how you think the project should handle conflicts (if at all?)
I'm quite new to Rust, but have a reasonable amount of experience with distributed document syncing, including conflict resolution, and am more than prepared to help work on this to fit my personal wiki needs!
When there are conflicting changes on the git remote, and on the wiki, deadwiki will push the unresolved merge conflict back up to the remote. This is preferable to losing the data on either side, but nothing in the logs or UI indicate a conflict has happened, and the rendering of a markdown file containing merge conflicts is kinda broken.
This is somewhat tricky, as changes are synced asynchronously, so the conflict isn't detected until after the user has submitted changes and sync has started. One basic approach could be to trigger a pull before saving a page, and at that point, notify the user a conflict has been detected, and ask them to resolve it manually in the markdown editor before saving again, but this adds quite a bit of overhead to saving of documents.
The text was updated successfully, but these errors were encountered: