debanjandhar12 / logseq-anki-sync

An logseq to anki syncing plugin with superpowers - image occlusion, card direction, incremental cards, and a lot more.
GNU Affero General Public License v3.0
421 stars 30 forks source link

All cards reset after Logseq sync remote graph created #245

Closed kieranlal closed 5 months ago

kieranlal commented 5 months ago

Describe the bug All my cards in Logseq were considered new after creating remote logseq sync graph in the cloud. I had been using Logseq sync without the cloud remote graph, just local graph, for the last 5 weeks. I enabled the remote cloud graph. This morning all my cards were considered new in Logseq Anki sync.

Steps to Reproduce: Steps to reproduce the behavior:

  1. Create a local remote graph for logseq sync only. Do not sync to cloud.
  2. Sync Anki with cards.
  3. Back-up Anki.
  4. Ensure old graph is not on iCloud anymore. Create remote graph in the cloud. Ensure you can time shift back to the original state of your graph.
  5. Sync Logseq Anki sync. Notice that all the cards are now new, even though you are using the same graph locally as before.
  6. Inspect similar cards: Added 2024-01-06 Position 979205405 Reviews 0 Lapses 0 Card Type Card Note Type Logseq-remoteModel Deck ThinkBayes2::01-Probability Card ID 1704570706833 Note ID 1704570706832

Added 2023-06-04 First Review 2023-06-04 Latest Review 2023-08-21 Due 2024-03-14 Position 979204978 Interval ⁨6.87⁩ months Ease 295% Reviews 6 Lapses 0 Average Time ⁨7.13⁩ seconds Total Time ⁨42.8⁩ seconds Card Type Card Note Type DocumentsModel Deck ThinkBayes2::01-Probability Card ID 1685891036869 Note ID 1685891036869 Date 2023-08-21 @ 15:40 2023-06-25 @ 11:55 2023-06-09 @ 12:25 2023-06-04 @ 14:27 2023-06-04 @ 14:25 2023-06-04 @ 14:24 Type Review Review Review Learn Learn Learn Rating 4 4 4 4 1 1 Interval ⁨6.87⁩ months ⁨1.9⁩ months ⁨16⁩ days ⁨5⁩ days ⁨1⁩ minute ⁨1⁩ minute Ease 295% 280% 265% 250%

Time ⁨5.97⁩s ⁨6.39⁩s ⁨9.52⁩s ⁨3.36⁩s ⁨7.35⁩s ⁨10.21⁩s

Expected behavior Expected that Cards would be the same before and after moving to remote graph in cloud.

Developer console screenshot: Please add a screenshot of the error in logseq's developer console if applicable. Logseq's developer console can be accessed by pressing Ctrl + Shift + I.

Device Information (please complete the following information):

kieranlal commented 5 months ago
Logseq-journal-files-location

I think this might be the source of the problem. It appears that when I created the remote graph all my journal files ended up in a different directory under Logseq-remote/logseq/version-files/base/Documents/journals instead of ...base/journals.

Presumably this caused all the cards to be identified as new and duplicated.

kieranlal commented 5 months ago

I picked an old journal from Feb 5, 2023 and moved it to where the new journal entries are being written but there was no impact after running Anki-sync. My theory that different markdown locations between where old and new journal entries was leading to new cards being created in Anki seems to be falsified.

I looked at the new and old cards in Anki and they have the same Sort Field, UUID-type, and UUID. The only difference I could see was that the config dependencyHash had a different Hash. The preview link in both cards points back to the same journal markdown file and I compared the blocks and they were identical.

image

debanjandhar12 commented 5 months ago

1) The version-files folder is used by Logseq for version control. It is not where logseq maintains the current state and likely not related to this problem. 2) From the screenshot, it seems like notes/cards were duplicated and not reset:

image 3) Was the graph name changed during / before / after creating remote graph? If yes, what is new name and old name? 4) Can you give me screenshot of your anki note types? [ Click Tools > Manage Note Types inside anki ]

kieranlal commented 5 months ago

The new graph is called: workspace/Logseq-remote(Logseq-remote) The old graph I assume was just labelled logseq. The folder has been renamed to logseq-backup in my user directory. image

Thank-you!

kieranlal commented 5 months ago

Old card with Note Type: DocumentsModel: image New card with Note Type: Logseq-remoteModel: image

debanjandhar12 commented 5 months ago

You can do either of following to retain old cards.

Process 1 (recommend)

Process 2

kieranlal commented 5 months ago

The first one worked. Thank-you very much.