~l3kn/org-fc#44: 
"No review data row found for this position"

Aloha,

I am using org-fc 0.6.2 Emacs 29.4, gawk 5.3.0, xargs 4.9.0, find 4.9.0. The following behavior persists even with no config (emacs -Q).

Whenever I use org-fc-review, I can get to a card and flip it, but upon rating I get the error "No review data row found for this position".

I turned on toggle-debug-on-error, here is the results after rating easy (though any rating except for skipping will cause this error).

Debugger entered–Lisp error: (error "No review data row found for this position") 
signal(error ("No review data row found for this position")) 
org-fc-review-rate(easy) 
org-fc-review-rate-easy() 
funcall-interactively(org-fc-review-rate-easy) 
command-execute(org-fc-review-rate-easy)

Enabling caching causes an error upon starting the review

Debugger entered–Lisp error: (wrong-type-argument char-or-string-p nil) 
signal(wrong-type-argument (char-or-string-p nil)) 
org-fc-review-next-card() 
org-fc-review((:paths buffer)) 
org-fc-review-buffer() 
funcall-interactively(org-fc-review-buffer) 
command-execute(org-fc-review-buffer record) 
execute-extended-command(nil "org-fc-review-buffer" nil) 
funcall-interactively(execute-extended-command nil "org-fc-review-buffer" nil) 
command-execute(execute-extended-command)

I believe this was due to misuse of the software on my part. I closed Emacs while running a review. I think that there is some mismatch of data that org-fc is expecting. If I can get some help cleaning up what went wrong I would greatly appreciate it. Deleting the *.tsv file from my emacs config directory did not help (nor does it regenerate). I can flip and rate cards using M-x org-fc-demo which is a good start.

– Mahalo

Status
RESOLVED CLOSED
Submitter
~zaijab2000
Assigned to
No-one
Submitted
7 months ago
Updated
7 months ago
Labels
No labels applied.

~l3kn 7 months ago

Can you recover the *.tsv file you deleted? I don't think it's related to the issue you're having and it might be useful to recover the state of a potentially broken card.

A card should have the following structure in your org files:

* Heading :fc:
:PROPERTIES:
...
:END:
:REVIEW_DATA:
| position | ease | box | interval | due                  |
|----------+------+-----+----------+----------------------|
| front    | 2.35 |   6 |    87.54 | 2024-10-15T23:51:22Z |
| back     | 2.80 |   7 |   946.86 | 2027-02-23T12:02:59Z |
:END:

Is only a single card affected or all cards? It is possible that you closed Emacs while the REVIEW_DATA part was being written and now it's in a state org-fc can't parse.

Feel free to share the affected org file or sub-section where reviews fail in this way, then I can try to replicate your issue and test possible solutions.

~zaijab2000 7 months ago

Here is an example card which is affected:

* {{持つ}@0} :fc:
:PROPERTIES:
:FC_CREATED: 2024-09-17T20:22:53Z
:FC_TYPE:  cloze
:FC_ALGO:  sm2
:ID:       387dcc98-80bb-43cd-bd91-dce96b1383b1
:FC_CLOZE_MAX: 2
:FC_CLOZE_TYPE: deletion
:END:
:REVIEW_DATA:
| position | ease | box | interval | due                  |
|----------+------+-----+----------+----------------------|
|        0 | 2.50 |   0 |     0.00 | 2024-09-17T20:22:53Z |
|        1 | 2.50 |   0 |     0.00 | 2024-09-17T20:22:53Z |
|        2 | 2.50 |   0 |     0.00 | 2024-09-17T20:22:53Z |
:END:
{{もつ}@1} {{to hold (in one's hand)}@2}

* Sort Org Mode headings by Date? :fc:
:PROPERTIES:
:FC_CREATED: 2024-02-23T20:07:44Z
:FC_TYPE:  normal
:ID:       ed160259-2e56-47fb-82c4-23d677df6842
:END:
:REVIEW_DATA:
| position | ease | box | interval | due                  |
|----------+------+-----+----------+----------------------|
| front    | 2.35 |   5 |    30.24 | 2024-08-31T13:08:22Z |
:END:

=C-c ^=

This problem affects all cards, even those which I have studied from before and new cards I have made for testing purposes and called the *-card-init functions on. If I go to another buffer with a flash card and call the review buffer function I get the same error.

I cannot recover the tsv file unfortunately. Do you know of all of the 'state files' that would be generated or used that I could regenerate?

~l3kn 7 months ago

Unfortunately I can't replicate the error you're seeing with an Emacs configuration that uses the same version of org-fc that's currently available on the main branch here. My Emacs version is 30.0.50 with org-mode 9.6.8 so this might be related to a difference in these versions.

To figure out where exactly this error happens, you can put your cursor on at the beginning of the heading of one of these cards and use M-: to run (goto-char (car (org-fc-review-data-position))). This should move your cursor to the :REVIEW_DATA: part of the buffer.

I suspect your org-fc is able to find the :REVIEW_DATA: drawer when searching for cards to review but not when it comes to updating it during a review but so far I have no idea why.

Alternatively you could try to run the tests in the tests/org-fc-review-data-test.el file but those depend on an external package el-mock. With that installed you can load (e.g. execute-buffer) both the tests/org-fc-test-helper.el file and the aforementioned review-data-test file, then run the tests with M-x ert.

The *.tsv file you deleted stored the history of your org-fc reviews (similar to a log of the review data for each position, combined with how you rated this position during reviews). It's not needed for org-fc to function and is just used for the review statistics in the dashboard.

~zaijab2000 7 months ago

(org-fc-review-data-position) returns (nil) when placed at the begining of a header and the goto-char function throws an error.

However! I updated to Emacs 30.0.60 and the issue went away. Unfortunately Guix has some weird compilation interactions with other packages but this package is sooo much more important than that. Thank you for pointing me in the right direction and for helping me on this!

~l3kn 7 months ago

I'm glad we found a workaround!

Did you check org-mode versions before and after the update? Maybe there's some compatibility issue in org-fc that should be either fixed or mentioned in the readme.

If you're happy with the current solution and if you can fix your other guix packages, we can also close this issue.

~zaijab2000 7 months ago

Aloha,

"~l3kn" outgoing@sr.ht writes:

I'm glad we found a workaround!

Me too :) back to learning comfortably!

Did you check org-mode versions before and after the update? Maybe there's some compatibility issue in org-fc that should be either fixed or mentioned in the readme.

M-: org-version' outputs 9.7.11'. I can't say if there is some latent incompatibility or just some strangeness on my end. If there's any Guix users who find this thread, use emacs-next' instead of emacs' package.

If you're happy with the current solution and if you can fix your other guix packages, we can also close this issue.

Yes, I am happy with the current solution. I agree to close this.

-- Mahalo

~l3kn REPORTED CLOSED 7 months ago

Register here or Log in to comment, or comment via email.