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

Is it possible to check conflicts/diff in any folder? #17

Open
dioni21 opened this issue Jan 3, 2022 · 10 comments
Open

Is it possible to check conflicts/diff in any folder? #17

dioni21 opened this issue Jan 3, 2022 · 10 comments

Comments

@dioni21
Copy link

dioni21 commented Jan 3, 2022

Sorry if this is not the correct channel for questions/support. I could not find any info on the readme.md

I had conflicts in a mobile instance. Since I cannot run plugins in mobile, I moved them to a temp folder to run in a desktop instance. To my surprise, apparently I cannot run it out of the conflicts folder, nor I can create such folder and move notes to it.

IIUC, the plugin is just a diff GUI. Maybe you could extend it to add this functionality, or create a new plugin with this specific intention. I can imagine other cases of use.

@imasaru
Copy link

imasaru commented Jan 11, 2022

Hello, @dioni21 😁

@dioni21 commented:
I had conflicts in a mobile instance. Since I cannot run plugins in mobile, I moved them to a temp folder to run in a desktop instance. To my surprise, apparently I cannot run it out of the conflicts folder, nor I can create such folder and move notes to it.

I would guess that the problem you are witnessing is the intended design, and that the conflict files are not meant to be moved—is there a need to move them, anyway?

Let's read @Ahmad45123 's explanation of Joplin's built-in conflict resolution functionality:

@Ahmad45123 wrote (Joplin Forum):
When a conflict occurs, Joplin first copies the current local note to a new Conflicts folder. Then it replaces the local note with the latest from the server.

The conflicts folder should appear on your PC colored Red.

Judging from this explanation and a brief look at Joplin's database structure, I would guess that Ahmad's plugin identifies conflicting files by checking the database for a field called is_conflict to determine if notes conflict with each other. I assume that Joplin automatically marks the field upon finding a conflict after synchronization with an external server.

Question: Are your mobile and desktop Joplin instances synchronized online?

If they were synchronized, then there would be no need to manually move your files anywhere folder, as the conflicts would be marked and shown automatically. The plugin as-is seems to check for conflicts in the entire Joplin database already.

Have I misunderstood your comment? Looking forward to your reply.

@CalebJohn
Copy link
Collaborator

If they were synchronized, then there would be no need to manually move your files anywhere folder, as the conflicts would be marked and shown automatically. The plugin as-is seems to check for conflicts in the entire Joplin database already.

Have I misunderstood your comment? Looking forward to your reply.

You're only misunderstanding is in how Joplin handles conflicts. Currently the conflicts folder is local to the device where the conflicts appear. In this case the conflicts are on mobile and are not available on the desktop. This plugin, however, is only available on the desktop.
It would be nice to always have this plugin available when dealing with conflicts, which is at the heart of @dioni21's request.

@Ahmad45123
Copy link
Contributor

I really apologize for the late reply. For some reason I never got a notification and I only saw this issue right now after I was mentioned.

Anyways, it has been requested multiple times and I already got approval to implement the feature. Just waiting until I have the time to get to it as I'm currently having my semester finals.

If anyone wants to do it. Feel free to go ahead and I wouldn't mind helping out.

@imasaru
Copy link

imasaru commented Jan 11, 2022

@Ahmad45123 Good luck with those finals! I'm having mine soon too.

@CalebJohn Thank you for the explanation! 😁

@Ahmad45123
Copy link
Contributor

Ahmad45123 commented Jan 11, 2022

Okay so I did a simple modification that will allow you to compare 2 different notes. Essentially you'll just be able to right click -> resolve conflict on any note outside of Conflicts folder and it will 100% work. I will not be releasing this on official Joplin just yet though as there's still work to be done regarding the UI. It's all about conflicts rather then comparing if I make sense. I probably won't get to it until February so I decided to just get something out not to leave you waiting.

You can either build it yourself: https://github.com/joplin/plugin-conflict-resolution/tree/feature/generalCompare
Or I've attached it built. Just copy the *.jpl to your profile's plugins directory directory ~/.config/joplin-desktop/plugins (This path might be different on your device - check at the top of the Options page in the Configuration screen).

joplin-plugin-conflict-resolution.zip

@imasaru
Copy link

imasaru commented Jan 12, 2022

@Ahmad45123 Oooh, cool! Yay!!

Thank you! 🙇‍♂️

@dioni21
Copy link
Author

dioni21 commented Jan 18, 2022

Okay so I did a simple modification that will allow you to compare 2 different notes.

PERFECT! Just what I needed, and solved all my conflicts!

there's still work to be done regarding the UI. It's all about conflicts rather then comparing if I make sense.

May I suggest something? If you find any notes with the same name, offer them first in the UI. Maybe ONLY them, unless you check a button to show other ones. Note sure if this is easy to do, but would help people with lots of notes.

I decided to just get something out not to leave you waiting.

And I thank you a lot for that!

Just used the zipped version, and got happy!

@caressofsteel
Copy link

I have conflicts on iOS using S3 sync. I installed the custom zip version provided, restarted Desktop, then proceeded to "fix conflict" from context menu on a note in my iOS conflicts list. After sync of both desktop and mobile, I see no changes to the note. It's still in the conflicts folder unchanged on iOS. If I make a change to this conflicted note on desktop, it is properly updated and removed from the conflicts folder on iOS.

If I find the time, it would be nice to update this tool to work with the latest version of Joplin. It saves a little time and it would be nice to resolve the conflict without affecting the note's modified timestamp. I'm using the following versions:

iOS:

  • Version: 12.10.5
  • Database: v42

Desktop:

  • Joplin 2.10.18 (prod, win32)
  • Sync Version: 3
  • Sync Type: Amazon S3
  • Profile Version: 42
  • Conflict Resolution: 1.2.3

@Ahmad45123
Copy link
Contributor

Ahmad45123 commented May 11, 2023

Hmm. I'm not sure if Joplin changed anything in their plugin API but I'll look into it this weekend.

Probably also push the zipped version found here officially haha

@Ahmad45123
Copy link
Contributor

@caressofsteel I've checked this issue further and there seems to be an issue with Joplin itself and not this plugin. If the conflict is first detected by the phone app, the conflict folder isn't synced to PC properly. Pretty sure it used to work so must be some sort of regression. You can open an issue in the main repo here: https://github.com/laurent22/joplin

I'll look into it if I have time but maybe laurent can find the cause quicker :)

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

5 participants