billthefarmer / diary

Android personal diary - forked from http://git.savannah.gnu.org/cgit/diary.git
https://billthefarmer.github.io/diary
GNU General Public License v3.0
276 stars 58 forks source link

Duplicate entries in wrong month or year. #151

Closed neil-edelman closed 3 years ago

neil-edelman commented 3 years ago

Sometimes it silently saves (and replaces) a duplicate entry (file) in the wrong month or year. Only noticed after several years of entries under version control.

billthefarmer commented 3 years ago

I have looked at the code – it doesn't seem possible to store an entry in two places at once. What exactly do you mean by version control? Also, from version 1.66, new entries are stored with a .md extension rather than .txt.

neil-edelman commented 3 years ago

I am on 1.70 and Samsung S9. I turned off markdown; the file still saves with a .txt extension, (I like this.) I put a git repository under the directory where I save my Journal so I can do version control on my entries, (thank you!)

Screenshot_20201130-182035_Termux

This is an example: I was working on 2020/10/21.txt in Diary, and it saved a duplicate entry in 2017/11/21.txt. I have entries going back to 2004, but no entries in 2017. I have also observed it overriding the last months entries, but I use git to simply ignore that behavior. I have little idea what triggers this, but I flip back and forth in time often.

billthefarmer commented 3 years ago

I have released a new version with updated save logic which may stop that happening.

neil-edelman commented 3 years ago

I've updated and it hasn't had this problem since; will post another issue if this happens again.

julianfoad commented 2 years ago

This bug happened to me today on v1.82 and I can reproduce it.

Here is one way to reproduce it.

What happens now:

The same happens with a two-finger scroll sideways which changes the month.

Fortunately it seems not to Unfortunately it will overwrite an existing file if there is one at the chosen date, so be careful with testing.

Hoping this is helpful to find the root cause.

[EDIT] My settings for this reproduction recipe include "Use custom calendar: yes."

billthefarmer commented 2 years ago

That was a good one, that's been in the app since I added the custom calendar. Sneaky calendar update via back door. That will be fixed in the next version.