aardappel / procrastitracker

a Windows time tracking application
http://strlen.com/procrastitracker/
483 stars 53 forks source link

uhm... the app just deleted everything #109

Open rvttor opened 6 months ago

rvttor commented 6 months ago

I went to check how many hours I had in a certain game and every data I have been tracking for nearly a year had just vanished? Something similar had happened once but it was just a bug with the filters, this time i tried everything and it won't come back so it's probably hopeless at this point, so i'm not really looking for a solution, just to inform people that there is not much point to using a tracking program that will just cull itself completely out of the blue. But thanks for the one year trial I guess.

aardappel commented 6 months ago

The app doesn't delete things like that, and it also keeps daily backups. It is very likely you can just restore it, as it describes on https://strlen.com/procrastitracker/ (search for db.PT)

tamr commented 5 months ago

This happened to me also on the first run (~30min), db and backups were empty. But now it runs for a few weeks and been restarted a few time - seems ok. Would be great to edit the colors, tags and see the tag's time tooltip by hovering on the graph, now it shows the total time in the status bar.

lslatr23 commented 4 months ago

I am regulary losing all records, like every 2-3 weeks or so. There is some database corruption issue or something like this. This should be no problem to fix nowadays I think.

And manually merging databases from backup is not so straightforward, you can then unknowingly add some records twice for example. This is the only major flaw of this program.

Maybe it should use real database instead of a file? Or some other mechanism, that the main database files does not get corrupted, some incremental writing or similiar technique, I dont really know about this topic. Maybe I should fork to procrastitracker-realDB :) . But I did not code or work with databases for the last 20 years, so the results would be dubious probably.

EDIT: not maybe loosing all records, but a lot of them, the database file gets smaller, I dont know how much exactly I have lost, but a lot. I don't know if all of them.

aardappel commented 4 months ago

No idea what could cause that, other than rebooting in the middle of a db write or so.. and even then, the start menu should have copies.

Been running this program for 15 years non-stop now without this ever occurring, and so have many others, so it is possible there is something on your system, like an anti-virus, that interferes, if it indeed happens regularly.

The current database is super compact and fast, which helps with keeping this program light weight so it can always run.

Even if there is a better database solution (which I am sure there is) I don't have have time to rewrite the entire app, a lot of the internal structure of the program is tied to the database format, and it is not a simple table structure either (it's a tree).

lslatr23 commented 4 months ago

What I'am maybe thinking could be the culprint : some filenames/programs names contain UTF-8 or some special characters, and maybe the database handling does not like this when working with those strings, for example see the attached picture, there is a filename in BOLD, also some weird program names. I think when the program comes in contact with some weird window name/filename, something gets corrupted, and not saved. Or maybe saved correctly, but not loaded correctly afterwards. Just my two cents.

I think for example the file with filename "yt5s.io-✨Fresh✨ - TIKTOK COMPILATION.mp4" will corrupt the database when you run it in VLC. If you rename some random mp4 file to this filename, play it, then it will show in statitics, then close the VLC, exit procrastitracker, run procrastitracker. The tree will end up corrupted.

procrasti-stats procrasti-stats2 procrasti-vlc2

lslatr23 commented 4 months ago

I think also the program that messes up the database for me is called FAR MANAGER, becasue its window names contains some uncommon characters like this :

procrasti-farmanager

procrasti-farmanager2

aardappel commented 4 months ago

I used your example filename of yt5s.io-✨Fresh✨ - TIKTOK COMPILATION.mp4 and was able to save and then load a database with it in it just fine, the filename showed up correctly after loading.

I inspected the load/saving code, and it all seems safe with regards of UTF-8 handling.

I don't think there is any problem with far manager either, it parses the {} in a funny way because it doesn't use them as special characters.. but there is nothing wrong with them.

bagajohny commented 2 months ago

Where are the databases stored? Is it possible to manually delete database to clear all data?

aardappel commented 2 months ago

There should be a shortcut to all database files in your start menu.

Erfaniom commented 4 weeks ago

There should be a shortcut to all database files in your start menu.

can you be more precise? this tells me absolutely nothing, i am also losing my data every couple of days, from what i have seen the maximum it can keep seems to be 5 days

aardappel commented 4 weeks ago

this tells me absolutely nothing

Depending on your version of Windows, your start menu should be that thing that pops up from the windows symbol in the lower left corner of your screen. Please follow these instructions: https://support.microsoft.com/en-us/windows/open-the-start-menu-4ed57ad7-ed1f-3cc9-c9e4-f329822f5aeb Then find and entry called ProcrastiTracker, followed by Database Files.

i am also losing my data every couple of days

No idea what would cause that.. see what you find in Database Files. You have something on your computer which either stops PT from reading/writing its files (like a rogue virus checker) or something that deletes them.

Erfaniom commented 3 weeks ago

this tells me absolutely nothing

Depending on your version of Windows, your start menu should be that thing that pops up from the windows symbol in the lower left corner of your screen. Please follow these instructions: https://support.microsoft.com/en-us/windows/open-the-start-menu-4ed57ad7-ed1f-3cc9-c9e4-f329822f5aeb Then find and entry called ProcrastiTracker, followed by Database Files.

can you just tell me the folder where they're saved?

lslatr23 commented 3 weeks ago

They are somewhere in your user folder. But it will not help you, the problem , at least by my judgement, is because if storing/loading application names which have weird characters(unicode, utf, or whatever), or parsing weird characters, I don't know, I stopped using this program, which is a pity because it was the BEST solution for me. Maybe during sommer I will try to find the problem, but I'am not a good programmer.

lepeter2010 commented 1 week ago

Would it be possible to create some protection or warning into the app when it crashes and restarts the database from zero? It happened at least six times for me during the last 3 years, although I know it is much less then the biweekly crashes for others. I know however that the last useful backup can be merged in as a workaround.

lslatr23 commented 1 week ago

Is the .db file in this attachement corrupted? Because when I run PT, and the close it, the .db file is saved with smaller size. Either it was currupted during latest saving, or it was saved correctly, but is not loaded correctly when I open PT. Maybe it can help with debugging. db.zip

aardappel commented 1 week ago

It getting a bit smaller on save is normal, it automatically merges nodes with very little time in them.

If a db loads, and you can see all the time tracked, it is not corrupted.