GitJournal / GitJournal

Mobile first Note Taking integrated with Git
https://gitjournal.io
GNU Affero General Public License v3.0
3.51k stars 241 forks source link

Moving leaves the original file in the repository #957

Open joserebelo opened 10 months ago

joserebelo commented 10 months ago

Moving a note to a folder leaves the GitJournal in an inconsistent state, where the original file stays in the repository, but is not visible anymore in the app.

This seems to be reproducible consistently:

  1. Create a note in the root folder
  2. Notice that it is added correctly
git commit - adding the note ```patch $ git show HEAD~2 commit 42f397861d177167786d65e65d0cca94ad0b8f04 Author: GitJournal Date: Mon Jan 29 13:13:20 2024 +0000 Added Note Test note that will be moved.md diff --git a/Test note that will be moved.md b/Test note that will be moved.md new file mode 100644 index 0000000..04ec36e --- /dev/null +++ b/Test note that will be moved.md @@ -0,0 +1,7 @@ +--- +created: 2024-01-29T13:13:11+00:00 +modified: 2024-01-29T13:13:20+00:00 +--- + +# Test note that will be moved + ```
  1. Move the note to a folder in the app
  2. Notice that while GitJournal only shows 1 note, a new note was created in the repository, instead of moving the file
git commit - moving the note ```patch ❯ git show HEAD~1 commit 43ff40d1c392b5b5d7f79150f15597469be1f97b Author: GitJournal Date: Mon Jan 29 13:13:30 2024 +0000 Moved Note Test note that will be moved.md -> Linux/Test note that will be moved.md diff --git a/Linux/Test note that will be moved.md b/Linux/Test note that will be moved.md new file mode 100644 index 0000000..04ec36e --- /dev/null +++ b/Linux/Test note that will be moved.md @@ -0,0 +1,7 @@ +--- +created: 2024-01-29T13:13:11+00:00 +modified: 2024-01-29T13:13:20+00:00 +--- + +# Test note that will be moved + ```
  1. We now have 2 notes in the repository, but only 1 shows up in GitJournal.
  2. Delete the note from GitJournal
  3. The note is not visible in GitJournal anymore, but the md file is still in the root of the repository
git commit - deleting the note ```patch ❯ git show HEAD | less commit e12cc64b25600c02f8f6ecb02c446788405a1a12 Author: GitJournal Date: Mon Jan 29 13:15:06 2024 +0000 Removed Note Linux/Test note that will be moved.md diff --git a/Linux/Test note that will be moved.md b/Linux/Test note that will be moved.md deleted file mode 100644 index 04ec36e..0000000 --- a/Linux/Test note that will be moved.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -created: 2024-01-29T13:13:11+00:00 -modified: 2024-01-29T13:13:20+00:00 ---- - -# Test note that will be moved - ```

Logs of the creation + move:

Logs ```json {"t":1706533990898,"l":"i","msg":"--------------------------------"} {"t":1706533990898,"l":"i","msg":"--------------------------------"} {"t":1706533990898,"l":"i","msg":"--------------------------------"} {"t":1706533990898,"l":"i","msg":"--------- App Launched ---------"} {"t":1706533990898,"l":"i","msg":"--------------------------------"} {"t":1706533990898,"l":"i","msg":"--------------------------------"} {"t":1706533990898,"l":"i","msg":"--------------------------------"} {"t":1706533990898,"l":"i","msg":"AppConfig","p":{"onBoardingCompleted":"true","collectCrashReports":"false","version":"0","validateProMode":"true","proMode":"false","debugLogLevel":"v","experimentalMarkdownToolbar":"false","experimentalAccounts":"false","experimentalTagAutoCompletion":"false","experimentalHistory":"false"}} {"t":1706533990899,"l":"d","msg":"Analytics Collection: false"} {"t":1706533990899,"l":"d","msg":"Analytics Storage: /data/user/0/io.gitjournal.gitjournal/files/analytics"} {"t":1706533990903,"l":"i","msg":"Repo Ids [0]"} {"t":1706533990903,"l":"i","msg":"Current Id 0"} {"t":1706533990904,"l":"d","msg":"Event.StorageConfig","p":{"folderName":"other","storeInternally":"true","storageLocation":"","id":"0"}} {"t":1706533990904,"l":"d","msg":"Event.FolderConfig","p":{"noteFileNameFormat":"FromTitle","journalNoteFileNameFormat":"FromTitle","yamlModifiedKey":"modified","yamlCreatedKey":"created","yamlTagsKey":"tags","yamlEditorTypeKey":"type","yamlHeaderEnabled":"true","defaultEditor":"Markdown","defaultView":"Card","defaultFileFormat":"Markdown","sortingField":"Modified","sortingOrder":"desc","showNoteSummary":"true","folderViewHeaderType":"TitleOrFileName","imageLocationSpec":".","titleSettings":"h1","inlineTagPrefixes":"#","emojify":"false","allowedFileExts":".md .txt .org","id":"0"}} {"t":1706533990904,"l":"d","msg":"Event.GitConfig","p":{"gitAuthor":"true","gitAuthorEmail":"true","sshPublicKey":"true","sshPrivateKey":"true","sshPassword":"false","id":"0"}} {"t":1706533990904,"l":"d","msg":"Event.Settings","p":{"customMetaData":"","defaultNewNoteFolderSpec":"false","journalEditordefaultNewNoteFolderSpec":"","journalEditorSingleNote":"false","remoteSyncFrequency":"automatic","version":"3","markdownDefaultView":"Last Used","markdownLastUsedView":"Edit","homeScreen":"all_notes","theme":"default","lightTheme":"LightDefault","darkTheme":"DarkDefault","zenMode":"false","swipeToDelete":"false","emojiParser":"true","bottomMenuBar":"true","confirmDelete":"true","id":"0"}} {"t":1706533990904,"l":"i","msg":"Loading Repo at path /data/user/0/io.gitjournal.gitjournal/app_flutter/notes/"} {"t":1706533990904,"l":"i","msg":"App Version: 1.87.0"} {"t":1706533990904,"l":"i","msg":"App Build Number: 3768"} {"t":1706533990906,"l":"d","msg":"BlobCTimeBuilder Cache Size: 8.19 Kb"} {"t":1706533990908,"l":"d","msg":"FileMTimeBuilder Cache Size: 8.05 Kb"} {"t":1706533990909,"l":"d","msg":"Loading MTimeCache: 96 items"} {"t":1706533990909,"l":"d","msg":"Loading CTimeCache: 102 items"} {"t":1706533990909,"l":"i","msg":"Branch master"} {"t":1706533990909,"l":"i","msg":"Cache Directory: /data/user/0/io.gitjournal.gitjournal/files/0"} {"t":1706533990909,"l":"d","msg":"Event.RepoSynced"} {"t":1706533990909,"l":"i","msg":"Trying to confirmProPurchase"} {"t":1706533990931,"l":"d","msg":"Received MediaFile Share with App (media): []"} {"t":1706533990933,"l":"i","msg":"Notes Cache Loaded: 20 items"} {"t":1706533990934,"l":"i","msg":"Finished loading the notes cache - 0:00:00.024575"} {"t":1706533990964,"l":"i","msg":"Built Git Time Cache - 0:00:00.030689"} {"t":1706533990964,"l":"d","msg":"Saving MTimeCache: 96 items"} {"t":1706533990964,"l":"d","msg":"Saving CTimeCache: 102 items"} {"t":1706533991026,"l":"i","msg":"Finished loading all the notes - 0:00:00.092050"} {"t":1706533992644,"l":"d","msg":"Saving MTimeCache: 96 items"} {"t":1706533992644,"l":"d","msg":"Saving CTimeCache: 102 items"} {"t":1706533993893,"l":"d","msg":"Synced!"} {"t":1706534000261,"l":"d","msg":"Note modified - saving"} {"t":1706534000261,"l":"d","msg":"Rebuilding Note's FileName"} {"t":1706534000262,"l":"d","msg":"Event.NoteAdded"} {"t":1706534000270,"l":"d","msg":"Got addNote lock"} {"t":1706534000307,"l":"d","msg":"Event.RepoSynced"} {"t":1706534001654,"l":"d","msg":"Saving MTimeCache: 97 items"} {"t":1706534001654,"l":"d","msg":"Saving CTimeCache: 103 items"} {"t":1706534001660,"l":"d","msg":"Note modified: Test note that will be moved.md"} {"t":1706534004127,"l":"d","msg":"Synced!"} {"t":1706534010064,"l":"d","msg":"Event.NoteMoved"} {"t":1706534010067,"l":"d","msg":"Got moveNote lock"} {"t":1706534010095,"l":"d","msg":"Event.RepoSynced"} {"t":1706534011456,"l":"d","msg":"Saving MTimeCache: 98 items"} {"t":1706534011456,"l":"d","msg":"Saving CTimeCache: 103 items"} {"t":1706534011479,"l":"d","msg":"Note modified: Linux/Test note that will be moved.md"} {"t":1706534013652,"l":"d","msg":"Synced!"} ```
austinweisgrau commented 4 months ago

Potentially related to #973

mostafatouny commented 3 months ago

Duplication problem is mainly addressed in https://github.com/GitJournal/GitJournal/issues/962