LostAlloy / LocalHistory-for-Visual-Studio

Local History for Visual Studio automatically creates a history of your files every time they are saved. The history can be compared with the current version.
https://marketplace.visualstudio.com/items?itemName=lostalloy.LocalHistory-for-Visual-Studio
17 stars 5 forks source link

Use a database instead of flat files #4

Open SugoiDev opened 6 years ago

SugoiDev commented 6 years ago

This would solve the issue of long paths and would reduce file system pressure. Idea came from issue #3

This issue will stay open until we implement or drop this idea.


Potential resources


Current requirements

aplocher commented 6 years ago

Well the first two sentences of the "how to corrupt a sqlite database" makes me feel a little better:

An SQLite database is highly resistant to corruption. If an application crash, or an operating-system crash, or even a power failure occurs in the middle of a transaction, the partially written transaction should be automatically rolled back the next time the database file is accessed.

in fact many of the filesystem-specific issues are related to POSIX systems. If you search for "Windows" on that page, most references are something like "this doesn't occur on Windows systems". And one Windows-specific issue that was fixed in a recent version of Sqlite.

Nevertheless, if there isn't a major resource cost, might be a good idea to keep a backup of a few databases on an interval - at least until we're comfortable it's nailed down. I hope to start looking at this tonight a little bit to see what it might take.

aplocher commented 5 years ago

I'm making good progress on this, but I'm finding a lot of overall plumbing in the app that could be removed and simplified. I hope you don't mind, but I'm switching the main view to use a ViewModel which will remove (or at least significantly reduce) the UI logic that is in place currently. Plus it will allow all data/logic being linked to the UI to be unit testable. I expect to have something ready this weekend I have the actual storage mechanisms all built for the DB and have a few unit tests built already that shows it storing the data properly.

SugoiDev commented 5 years ago

Awesome!

I hope you don't mind

This code is pretty old and in dire need of a overhaul, so that's all very welcome!

I almost did the changes you'll be doing now when I went to add the labels feature and found everything was in a single class, but decided against it since I wasn't using VS much at the time and would end up delaying the release too much.

aplocher commented 5 years ago

Hey I just wanted to give you an update. We were rounding out a pretty big sprint at work and some issues came up (and are still somewhat ongoing) so I've been pulling more 24 hour work days than I ever thought the human body was capable of handling over the last week or two. So needless to say I haven't touched this during that time. I'm hoping to be back on this project in the next day or two. I'm very close to having something working with this, just had to put it aside for a bit...

SugoiDev commented 5 years ago

Oh, thanks for the update!

Do your best and don't worry about it much!

DarrenSem commented 3 months ago

Hey I just wanted to give you an update. We were rounding out a pretty big sprint at work and some issues came up (and are still somewhat ongoing) so I've been pulling more 24 hour work days than I ever thought the human body was capable of handling over the last week or two. So needless to say I haven't touched this during that time. I'm hoping to be back on this project in the next day or two. I'm very close to having something working with this, just had to put it aside for a bit...

Dang @aplocher that big sprint is still going eh? 😦