Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check both front and back for metadata to avoid generating new CardIDs #129

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

ccammack
Copy link
Contributor

@ccammack ccammack commented Jun 9, 2024

To reproduce bug #128, enable anki.md.insertNewCardID and run Anki:Send To Own Deck multiple times on this deck and note that it generates new CardIDs each time:

# Test CardID Bug

## Front (2024-06-08 19:51:42)
%
Back (2024-06-08 19:51:42)

## Front (2024-06-08 19:51:56)

%
Back (2024-06-08 19:51:56)

## Front (2024-06-08 19:52:04)
%

Back (2024-06-08 19:52:04)

## Front (2024-06-08 19:52:13)

%

Back (2024-06-08 19:52:13)

## Front (2024-06-08 19:52:20)
Back (2024-06-08 19:52:20)

## Front (2024-06-08 19:52:25)

Back (2024-06-08 19:52:25)

Apply the fix and repeat the test to see that the CardIDs are only generated once..

@jasonwilliams
Copy link
Owner

Thanks, I can confirm this patch works and I have tried the reproduction steps listed in the linked-issue.
I've noticed this doesn't actually update the contents of the card in Anki but I think we never got around to implementing this.

looks like just linting left to sort out

@ccammack
Copy link
Contributor Author

ccammack commented Jun 9, 2024

Updates seem to work for me on the test deck if anki.md.updateCards is enabled.

@jasonwilliams
Copy link
Owner

ah yes thanks, just tested and it works fine, I can see the bug is fixed.
The CI looks unrelated so ill ignore that, it would be great if we had a test suite for this, but I won't hold up this PR on that basis

@jasonwilliams jasonwilliams merged commit cc6303d into jasonwilliams:main Jun 9, 2024
1 of 2 checks passed
@jasonwilliams
Copy link
Owner

This has been released:
https://github.com/jasonwilliams/anki/releases/tag/v1.3.3

@ccammack ccammack deleted the fix-card-ids branch June 9, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants