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

[BUG] setting a custom keyword for a character doesn't update related production characters #205

Open
izik1 opened this issue Dec 11, 2023 · 1 comment · May be fixed by #207
Open

[BUG] setting a custom keyword for a character doesn't update related production characters #205

izik1 opened this issue Dec 11, 2023 · 1 comment · May be fixed by #207
Labels
bug Something isn't working

Comments

@izik1
Copy link

izik1 commented Dec 11, 2023

Describe the bug
Kinda a two for one in the same spot
setting a custom keyword for a character doesn't update the keyword in production characters it's a primitive of/are primitives of it
also, by the same effect, updating the story/keyword of a card updates all recognition cards.

To Reproduce
Steps to reproduce the behavior:

  • make/already have production and recognition cards for: , ,
  • update the keyword of 音 (perhaps to おと, or, if we feel like using ascii, sounds, just, something different than the default or whatever it already is)
  • if you have a large number of recognition cards, notice the wait time
  • observe that every recognition card in the collection wants to sync (for me that's over 1000 cards in my next sync!)
  • observe that 日 and 暗 still have the old keyword for 音 when viewed through their production cards in the card browser, but when viewed the recognition card are updated.

This query filter is off incorrect:

note_ids = aqt.mw.col.find_notes(
" OR ".join(ct_find_filter) + f' AND "Character:{character}"'
)

Expected behavior
When updating a keyword / story, all related notes should update (to have the right keyword for the original note) and only those notes should update.

Desktop (please complete the following information):

  • OS and Version: Linux (NixOS, actual OS details unimportant)
  • Anki Version 23.12beta2 (presumably no related issues with Anki itself)

Additional context
I'm willing to fix this (even have a partial fix ready), just want to write it down and be told "yeah, sure"

Screenshots
If applicable, add screenshots to help explain your problem.

@izik1 izik1 added the bug Something isn't working label Dec 11, 2023
@mjuhanne
Copy link
Contributor

mjuhanne commented Dec 12, 2023

Ah, good catch! I had already fixed the 'every recognition card wants to sync' problem here ages ago in my repository but I missed including that into previous PR.
What still needs to be done is iteratively update also every child-note in the primitive_of list (function refresh_notes_for_character).

If you have time, please do contribute with your fix, test it and make a PR (I'm currently tied up with another feature I'm working on).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants