17 Commits

Author SHA1 Message Date
657721adc6 Update dart-git and stop using the Result class
Instead we're going to move back to standard exceptions.

Using a custom Result class has created far far more problems
- The Stacktraces aren't always right
- Sometimes one forgets to check the Result error
- All other exception throwing code needing to be converted to Results
- Non idiomatic Dart code

I think it's better to just go back to exceptions. They have their
problems, but overall, I think it's a better approach.
2023-11-24 14:03:30 +01:00
6237161a28 Enable logging in tests
It makes it easier to diagnose issues on the CI
2022-02-20 01:24:07 +05:30
b38c97454b Compute the file hash on saving a note
It's not ideal as the hash is now calculated twice, but it simplifies
such a large porition of the code as I can put proper asserts to make
sure all Files in the NotesFolderFS always have a valid GitHash.
2022-01-20 15:43:22 +01:00
0488714e89 Refactor note file naming logic
I want to make the note class immutable, and the file path naming logic
is the toughest part.
2022-01-14 12:55:27 +01:00
de5cec30f3 Avoid using the same hive cache for all the materialized views
We were using the same one for each repo.
2021-12-26 18:32:46 +01:00
e1ea7a4953 Fetch the modified + created time from git
Fixes #78

This is probably the largest commit that I have ever made. From now on -
every File always has an mtime and ctime which is fetched from git.
Notes can optionally override that time by providing yaml metadata.

Additionally the 'filePath' and 'folderPath' is now relative to the
repoPath instead of being the full path.

This will slow down GitJournal like crazy as all the mtimes and ctime
still need to be cached. For my test repo it takes about 23 seconds for
GitJournal to become responsive.
2021-10-26 17:49:08 +02:00
7a56d0f423 Remove Note's default constructor
Instead there is a new type called 'UnopenedFile'. This was part of my
effort to not have everything inside the 'Note' class and to make it a
bit more immutable.

But, wow, this took a very long time. The 'Note' class seems to be very
deeply integrated everywhere.
2021-10-18 13:03:22 +02:00
6a915864f2 Move NotesFolder's code to their own folder
The 'core' folder is becoming way too huge.
2021-10-15 12:31:35 +02:00
c4ef1f569b Use flutter_lint
Instead of picking lint values. This way I don't need to routinely
looking at extra lints to enable.
2021-09-21 15:42:13 +02:00
fb2ebcdd6c Reuse: Add licenseing to the tests 2021-09-15 13:11:50 +02:00
c53b7ebbd1 Note: fileLastModified should never be null
This simplifies so much of the code.
2021-09-07 00:00:42 +02:00
d3fae40173 Rename views to providers
The providers give a View
2021-09-06 14:32:25 +02:00
d209ed4d30 MaterializedViewProvider: Make the fetch function async
Also make the contructor sync, this makes everything much easier.
2021-09-06 14:15:38 +02:00
130eb852b2 Note: Move summary to a MaterializedView
This way it doesn't need to be computed each time the app loads.
2021-08-31 21:48:27 +02:00
5b9106eb2c MaterializedView: Make the key shorter
Just use the path spec, but calculate it in a faster way.
2021-08-31 20:57:03 +02:00
6e6bd5f070 Materialized View Test: Avoid using the path provider
Hive Flutter uses the path provider. Lets avoid that, as then we can
skip mocking it out.
2021-08-31 19:07:12 +02:00
096d3a8278 Rename NoteView -> NoteMaterializedView
It is stored in the disk
2021-08-31 17:12:42 +02:00