MartinSGill / TodoTxtJs

A Javascript web app implementation of TodoTxt
72 stars 29 forks source link

Conflicts #58

Closed jamierc closed 10 years ago

jamierc commented 10 years ago

When syncing to dropbox, TodoTxtJs continually creates new todo.txt files, appending 'conflictedversion' to the filename. It would be more elegant if it reported any conflicts and asked what the user wanted to do - ie ignore, overwrite.

MartinSGill commented 10 years ago

thanks for reporting this.

I'm aware of the issue and been trying to think of a neat solution. The problem seems to be that with auto-save turned on it's saving too fast. The "conflicted version" is actually dropbox trying to make sure you don't overwrite a file that might have changed in two locations.

This issue was introduced as part of a number of changes to make dropbox more reliable. I'll need to keep working away at this.

A work-around is to not make too many changes too quickly.. e.g. wait for the "saved" message before click on another completed, or before deleting a Todo. I agree that this is annoying and I'll try to come up with a proper solution.

jamierc commented 10 years ago

Thanks Martin. I hadn't realised that this was a dropbox 'feature' rather than yours. I suppose another workaround would be to disable autosave - which actually wouldn't be a big deal for me.

Thanks for this service by the way - works beautifully.

schilke commented 10 years ago

Seems a bit odd as I recognized this problem earlier but it hasn't been a big deal, yet. For some days now I can't use TodoTxtJs anymore as it always makes a conflicted copy - no matter how long I wait (even if I leave it for minutes) and no matter if I've turned auto save on or save manually instead. The only thing that seems to work is a complete reload (what's not really an alternative on my 2GB netbook...). Do you think an own server solution could get around this (yes, Ive read the issues dealing with that)? Besides that: the best attempt out of all for us who don't have all ten fingers at the command prompt all the time. I like to "see" my contexts and projects when I make a new entry - and I really like the feature to see a project at a glance with one click. Plus the autosuggest is also very handy. Keep up the good work!

schilke commented 10 years ago

I'm afraid to report that the issue still persists for me. I can do a first entry/change without any problems, if I perform a second action (no matter when or what) a conflicted copy is created. I'll do a few more tests. Just to confirm it's not a problem of my local machine or connection: David Pratten's TodoTxtTDI, Gina's Android app and hacking the file with Sublime Text just work fine without any conflicts.

schilke commented 10 years ago

Furthermore I've noticed that the loading time went from aweful into the no-go area. It's a JS app, well, that means the tiny Atom of my netbook will have some work - but I'm now @ 3 minutes for a - wait a minute - todo file with 462 lines. I'll do a few tests without extensions and probably also in FF just to make sure...

MartinSGill commented 10 years ago

I've never tested with a file that big. I'll need to create one. I suspect it's the size of the file that's the cause.

The larger the file, the more work the app needs to do, the more memory it uses, and the longer it takes to load/save it. All of that contribute to slow saves, which in turn can contribute to conflicted saves.

If most of those lines are completed todos, then I recommend archiving them to a different file. In any case, I'll experiment with larger files when I get time and see what happens.

jamierc commented 10 years ago

Martin, thanks for the fix. I'm testing and will comment in due course.

Speed is fine with me. 460 tasks is, I would imagine, well outside the typical use case!!

MartinSGill commented 10 years ago

@schilke One thing to try is to make sure that you clean out your dropbox folder. Ensure you've removed all "conflicted" files, make sure your todo.txt is the latest and then reload the app.