# Automatic conflict resolution

**URL:** <https://discourse.joplinapp.org/t/automatic-conflict-resolution/49050>\
**Category:** GSoC\
**Created:** [10 March 2026 15:37 UTC](https://discourse.joplinapp.org/t/automatic-conflict-resolution/49050 "2026-03-10T15:37:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shatakshi01](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@shatakshi01](https://discourse.joplinapp.org/u/shatakshi01)\
**Post date:** [10 March 2026 15:37 UTC](https://discourse.joplinapp.org/t/automatic-conflict-resolution/49050/1 "2026-03-10T15:37:32Z")

</div>

Automatic conflict resolution  
Implement a mechanism to automatically resolve note conflicts where possible, and provide semi-autonomous or assisted conflict resolution when automatic resolution is not feasible. Note conflicts occur when a note is edited while the local version is not synchronized with the latest version stored on the server. At present, resolving these conflicts requires manual intervention, which can be time-consuming and particularly challenging for longer notes, especially on mobile devices. The project may optionally explore the use of AI to assist with the conflict resolution process, though this is not a required component.  
Expected Outcome: The project will deliver an automatic note conflict resolution system that works consistently across both desktop and mobile versions of the app. The algorithm should automatically merge changes whenever possible while preserving all information. When this cannot be guaranteed, the application should provide semi-autonomous or assisted conflict resolution with a clear summary of the proposed changes and any potential information loss. Assisted conflict resolution must not interrupt synchronization and should be managed through a separate user interface.  
how i solve:-

1. Detect Conflicts  
When syncing, compare:  
Local Version  
Server Version  
Base Version (last synced version)  
If both local and server versions changed → conflict detected.
2. Automatic Merge (3-Way Merge)  
Use a 3-way merge algorithm similar to Git.  
Steps:  
Split note into lines or blocks  
Compare changes from:  
Base → Local  
Base → Server  
If edits are in different sections, merge automatically.  
Example:  
Base  
Buy milk  
Buy bread  
Local  
Buy milk  
Buy bread  
Buy eggs  
Server  
Buy milk  
Buy bread  
Buy butter  
Auto-merge result  
Buy milk  
Buy bread  
Buy eggs  
Buy butter
3. Conflict Marking (When Auto Merge Fails)  
If the same text section was modified, mark conflict blocks:  
\<\<\<\<\<\<\< Local  
Updated text A  
=======  
Updated text B

> > > > > > > Server  
> > > > > > > Save both versions to avoid data loss.

1. Assisted Conflict Resolution UI  
Create a Conflict Resolution Screen:  
Features:  
Side-by-side comparison  
Highlighted changes  
Buttons:  
Keep Local  
Keep Server  
Merge Both  
Short summary of differences  
Important:  
This UI runs after sync, so sync is not blocked.
2. Optional AI Assistance  
AI can help suggest merges:  
Functions:  
Summarize differences  
Suggest merged version  
Highlight potential information loss  
Example output:  
AI suggestion: combine both edits while preserving added paragraphs.  
User still confirms final result.
3. Cross-Platform Implementation  
Implement merge logic in the shared core sync engine, so it works on:  
Android  
Windows  
Linux  
macOS  
iOS  
UI layer handles assisted resolution.

---

<div class="post-metadata">

**Author:** ![mrjo118](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/mrjo118/32/23404_2.png) [@mrjo118](https://discourse.joplinapp.org/u/mrjo118)\
**Post date:** [10 March 2026 17:08 UTC](https://discourse.joplinapp.org/t/automatic-conflict-resolution/49050/2 "2026-03-10T17:08:47Z")

</div>

Thank you for your proposal, but I find it to be not very clear, and it does not give much detail about how you intend to implement what is described in each section. In particular, section 5 just gives priniciples about what could be done with AI, without any indication of how it could actually be integrated with the solution.
