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

Both local and remote notebook have been modified #35

Closed
gitfoxi opened this issue Mar 6, 2017 · 25 comments
Closed

Both local and remote notebook have been modified #35

gitfoxi opened this issue Mar 6, 2017 · 25 comments

Comments

@gitfoxi
Copy link

gitfoxi commented Mar 6, 2017

Now what?

I could minimize the chance of this happening by setting auto-save in emacs, make sure dropbox is always running with a big warning if network can't connect.

On the orgzly side it would make sense to sync both before and after adding a new note.

But still, conflict is inevitable. The only way forward now seems to be to clear the database and start over. I guess I'd prefer some options like diff, merge, rename, remote wins, local wins.

This is happening on my first day of use; The very first time I tried adding a note with orgzly. I guess more experienced users have discovered a practice to avoid the situation. Please share how you do it.

Update

Clear database is not a great idea. You lose all your settings.

Occurs to me that if org files were simply saved on Google Drive as a text file that the system would take care of synchronization. Is that what others are doing?

@danShumway
Copy link

danShumway commented Mar 6, 2017

You can force load or force save a single note with a long tap.

I believe there's also an option to create a duplicate, at which point you could do a local git diff if you wanted. And I'm sure I'm misremembering, but I thought that auto-merge was being discussed at some point? Probably just wishful thinking. In any case, there's no need for you to clear the database, just choose the version you want and sync that.

I do run into this occasionally, but not too often. I'm not a fan of auto-syncing on orgzly's side, I like that I can control data usage - but I can see how having the option would be useful, and would probably clear up a good deal of issues like this for other people.

TLDR, get into the habit of syncing regularly when you open the app, make sure dropbox is always running locally, many of these issues will go away. If something goes wrong, force pull/push and continue from there - if syncs are happening regularly, you should rarely ever lose more than one or two items. Autosync would likely help with that, but I prefer manual syncing and rarely get bitten by it.

@nevenz
Copy link
Member

nevenz commented Mar 9, 2017

I was playing a bit with merging long time ago. It shouldn't be too hard to use a plain diff/patch approach for start, though I'm not sure how often that would work.

Long-term, every change to a note could be encoded and saved and then reproduced, but that would require each note having an ID (like MobileOrg does). I've been passionately avoiding that, though it might be necessary for some other features too (dependencies, internal linking, etc).

Occurs to me that if org files were simply saved on Google Drive as a text file that the system would take care of synchronization. Is that what others are doing?

It's the saving to Google Drive part that can cause a conflict. :)

Problem with conflict in Orgzly is not different from the same issue Dropbox and Google Drive have. If you were to "Pause syncing" in Dropbox for example, you'd soon run into it. :)

So yeah, some of the options:

  • Implement auto synchronization #8 for minimizing the chance of conflict
  • Auto-merge (which I'm not a fan of personally, it sounds too scary to me, it would have to be initiated by user explicitly)
  • Copy file on conflict - which is what other services like Dropbox are doing

@ghost
Copy link

ghost commented Apr 7, 2017

I actually like the auto-merging feature, especially if it keeps the conflicts marked in the text, like git does on a conflict:

 <<<<<<< HEAD:mergetest
 This is my third line
 =======
 This is a fourth line I am adding
 >>>>>>> 4e2b407f501b68f8588aa645acafffa0224b9b78:mergetest

This is really easy to see and resolve manually, later, without having to compare two individually saved files (like your 3rd bullet). However, it probably requires having a common "baseline" version that your other two versions forked from, so you can see what the conflicts were and diff them independently. And, there's the rub, I guess.

@mkaito
Copy link

mkaito commented Apr 30, 2017

This situation can usually be avoided by being religious about hitting 'sync' before and after anything you do. However, there's one major issue with this: Sending anything to orgzly via 'share' does not sync first. So if I made any changes on the computer, and later find something on the phone that I want to save in orgzly, there's no way to avoid a conflict unless I remember to manually switch to orgzly first and sync.

@colonelpanic8
Copy link
Contributor

The git synchronization I'm working on in #173 should handle most (any cases that git itself would handle) of this properly.

@inducer
Copy link

inducer commented Nov 18, 2017

Sorry to be dense, but where is this "Force load"/"Force save" option? I can't find it in 1.6 from Fdroid. As a result, I'm not currently sure how to recover from a conflicted notebook.

@colonelpanic8
Copy link
Contributor

@inducer Doesn't exists. Would need a changes to the repo interface as of right now.

@nevenz
Copy link
Member

nevenz commented Nov 18, 2017

Sorry to be dense, but where is this "Force load"/"Force save" option?

In the list of notebooks, long-click one of the notebook to open the menu. You will lose changes on one side of course, as the name implies.

Doesn't exists. Would need a changes to the repo interface as of right now

This is for Git sync, right?

@inducer
Copy link

inducer commented Nov 18, 2017

In the list of notebooks, long-click one of the notebook to open the menu. You will lose changes on one side of course, as the name implies.

OIC, found it. Thanks! I was trying long-click in the left-side pull-out menu, which didn't do much.

@abhaymittal
Copy link

OIC, found it. Thanks! I was trying long-click in the left-side pull-out menu, which didn't do much

For some reason, it does not work for me. I am using the android version of the application and nothing happens when I long click on the notebook name in the Notebooks menu. Any ideas on what could be wrong?

@inducer
Copy link

inducer commented Mar 13, 2018

No, not the menu. Click on "Notebooks" in the menu, which will give you another list of notebooks. Long-pressing on those gives that option.

@abhaymittal
Copy link

No, not the menu. Click on "Notebooks" in the menu, which will give you another list of notebooks. Long-pressing on those gives that option.

Got it, Thanks a lot!

@vclvm
Copy link

vclvm commented May 15, 2018

I believe "force load" and "force save" are a bit confusing - save local to cloud or cloud to local? Same goes with load, probably not confusing for native speakers, but I'm confused. Something more opposite like upload/download would be more obvious.

@nevenz
Copy link
Member

nevenz commented May 17, 2018

I believe "force load" and "force save" are a bit confusing - save local to cloud or cloud to local? Same goes with load, probably not confusing for native speakers, but I'm confused. Something more opposite like upload/download would be more obvious.

It's not always the cloud though, it can be a local directory. So even upload/download don't seem right I think.

Perhaps localization is an option?

@vclvm
Copy link

vclvm commented May 17, 2018

It's not always the cloud though, it can be a local directory. So even upload/download don't seem right I think.
Perhaps localization is an option?

There are some reasons for my phone to be in English locale, so localization is not an option in my case.
I see the problem with upload/download, may be something around internal/external will do better? E.g. Save internal and Save external are pretty straightforward.

@NQNStudios
Copy link

Just started using Orgzly and ran into this issue.

@nevenz
Copy link
Member

nevenz commented Apr 27, 2019

Just started using Orgzly and ran into this issue.

Have you managed to resolve the conflict?

@NQNStudios
Copy link

NQNStudios commented Apr 27, 2019 via email

@mkrauss
Copy link

mkrauss commented Jun 19, 2019

For Emacs users, a reasonably decent fix when this happens is this:

  1. Open the notebook file in Emacs first.
  2. Force save it from Orgzly.
  3. Once Dropbox syncs, either of two things will happen, depending on your Emacs config:
    3a. If Emacs automatically reloads the file: you should be able to immediately hit undo in Emacs, returning the buffer to the state before the sync, and leaving it in an unsaved state, then proceed to step 4.
    3b. If Emacs does not automatically reload the file: I haven't tried it, but it should be fine to just proceed to step 4 without intervention; although it won't show that the file is unsaved, I'd guess it should work.
  4. Run M-x ediff-current-file which gives you an ediff session comparing the buffer to the saved file. You can now use ediff and/or manual editing to resolve the differences and keep whatever you like, then resave the file, and sync in Orgzly again to load your fixed version.

That may sound complicated but it's really quite easy, and if you haven't used ediff, it's great - just hit ? to toggle a quick cheatsheet. Give it a try!

@Asalle
Copy link

Asalle commented Nov 11, 2019

Is it possible to add something like "view merge confilits diff"? I often fix merge conflicts by hand and for that I will have to skim through an entire file. Even the worst diff would be so much more helpful! Thank you for the amazing app btw!

@nevenz
Copy link
Member

nevenz commented Nov 12, 2019

Is it possible to add something like "view merge confilits diff"? I often fix merge conflicts by hand and for that I will have to skim through an entire file.

Sounds good, can you open a new issue? Thanks!

@Asalle
Copy link

Asalle commented Nov 12, 2019 via email

@Asalle Asalle mentioned this issue Nov 12, 2019
1 task
@Diomas
Copy link

Diomas commented Jun 1, 2020

I've fall into the same issue, and I want my orgzly changes override ones that are in the directory (I'm using Syncthing).
Now the question is which of this buttons keeps changes made in orgzly and discards changes in the directory:
image
I'm afraid to tap any of them, since the meaning of these icons is not obvious for me :)

@Asalle
Copy link

Asalle commented Jun 1, 2020 via email

@oatberry
Copy link

oatberry commented Jun 6, 2020

I'm afraid to tap any of them, since the meaning of these icons is not obvious for me :)

There's a thing you can do, I think in almost all (if not every) android app, where if you press and hold an icon button, it'll show a tooltip with the name of the button :)

@nevenz nevenz closed this as completed Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests