l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
258 stars 31 forks source link

Old card are getting deleted somehow? #115

Closed vkar-hub closed 8 months ago

vkar-hub commented 9 months ago

Hi,

Many of my old cards have disappeared after running this app. This is I think the third time I've noticed this happen but I have no idea how to recreate this issue. I have a large file with lots of data but as far as I've observed only my flashcards have disappeared and not other headings. I use Cloze for everything. Any idea how I could troubleshoot this?

Thanks

l3kn commented 9 months ago

This sounds very strange and concerning.

Org-fc should only ever delete and update (delete and insert again) the text inside the :REVIEW_DATA: block of each heading.

For some context, how many cloze cards are we speaking of (ones you're using, not ones that have disappeared)?

I assume with enough cards it would be hard to tell if a handful disappears somehow... During a period of two weeks some months ago I've tracked the number of cards in my system (~2000 of which are cloze cards, some with tens of holes) while reviewing around 1000 cards per day and there are no decrements in these counts. The current count also seems to match up with what I would expect.

It seems like the easiest test would be to create a backup copy of the file (or directory) you're working with and compare with that after some reviews.

One glitch I've noticed is that sometimes headings seem to disappear after a review but they are only hidden with overlays and re-appear after closing and opening the file again.

vkar-hub commented 9 months ago

Thanks for replying promptly. Okay I have a file of ~14000 lines with 700 cards and 1200 positions in total. I review around 200-300 a day. It's small enough that it's possible to realize something isn't showing up after a while.

They have definitely been deleted. Just not sure when and how. I will try to use git to track changes to file consistently for a while and see if there's anything to be concerned about.

l3kn commented 9 months ago

Using git is even better than just keeping a copy. If you don't want to commit the file manually, you could use the org-fc-after-review-hook to run a shell command.

I've searched though the code and only org-fc-review-data-set deletes parts of the buffer, and those are given by the bounds reported by org-element-at-point after searching the current heading for the name of the review-data drawer and verifying that the current element is really a drawer. This seems resistant against deleting the :END: marker in the org version (9.6.3) I'm using.

Which org-version are you using? Maybe there's been some change in that code with an edge-case where the block bounds would begin in one card and end in another.

Please keep me updated on your findings with git.

vkar-hub commented 8 months ago

Haven't come across anything, I think it must be something else. Closing this now.

l3kn commented 8 months ago

Thanks for the update. I'm glad there doesn't seem to be anything wrong with org-fc in this case.