-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Options group created from another options group inherits its uuid (minor issue) #118
Comments
aplaice
added a commit
to aplaice/CrowdAnki
that referenced
this issue
Jul 3, 2021
Fix Stvad#118. Testing, it seems that I somehow haven't broken the tests despite fiddling with anki/hook_vendor without adding to the overrides. Note that disambiguate_crowdanki_uuid is not available as a "legacy" hook, so the new hook mechanism has to be used. It might (or might not) be worth converting the existing hooks to the new mechanism.
aplaice
added a commit
to aplaice/CrowdAnki
that referenced
this issue
Jul 3, 2021
Fix Stvad#118. Testing, it seems that I somehow haven't broken the tests despite fiddling with anki/hook_vendor without adding to the overrides. Note that deck_conf_did_add_config is not available as a "legacy" hook, so the new hook mechanism has to be used. It might (or might not) be worth converting the existing hooks to the new mechanism.
aplaice
added a commit
to aplaice/CrowdAnki
that referenced
this issue
Aug 22, 2021
Fix Stvad#118. Testing, it seems that I somehow haven't broken the tests despite fiddling with anki/hook_vendor without adding to the overrides. Note that deck_conf_did_add_config is not available as a "legacy" hook, so the new hook mechanism has to be used. It might (or might not) be worth converting the existing hooks to the new mechanism.
aplaice
added a commit
to aplaice/CrowdAnki
that referenced
this issue
Aug 22, 2021
Fix Stvad#118. Testing, it seems that I somehow haven't broken the tests despite fiddling with anki/hook_vendor without adding to the overrides. Note that deck_conf_did_add_config is not available as a "legacy" hook, so the new hook mechanism has to be used. It might (or might not) be worth converting the existing hooks to the new mechanism.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use Anki's interface for creating new options groups (or "deck configs" in CrowdAnki terms), by clicking on the cog next to a deck, selecting "Options" > "Options group" > "Manage" > "Add"*, then the newly created options group will be a "clone" of the previously selected options group.
* I think that this is the only way to create an additional options group, in Anki, without add-ons.
In particular, this means that the newly created "deck config" will inherit/share the
crowdanki_uuid
of its "parent" "deck config".To reproduce
deck_config_uuid
(or alternatively thecrowdanki_uuid
indeck_configurations
) of the snapshotted deck.deck_config_uuid
of the snapshotted deck.(Tested with Anki 2.1.39, on Linux.)
Expected behaviour
The two
deck_config_uuid
s are different.Actual behaviour
The two
deck_config_uuid
s are the same.Further information
Alternative order
If you perform the actions in a different order — i.e. create a second options group and switch back to the first options group before the first snapshot, and switch to the already created second options group after the first snapshot, then the
deck_config_uuid
s will be different.(Full alternative order:
deck_config_uuid
(or alternatively thecrowdanki_uuid
indeck_configurations
) of the snapshotted deck.deck_config_uuid
of the snapshotted deck.)
The
deck_config_uuid
s are different, because the second options group was created before a UUID was assigned to the first options group, so the UUID was not copied over when "cloning".(This suggests that this isn't an issue with the retrieving of assigned UUIDs, just a natural consequence of the way Anki creates new options groups.)
Anki source code context
The code for adding a new options group is here, and as one can see, the new group is cloned from the old one.
Severity
This is obviously a rather minor issue. It may often result in duplicate
deck_config_uuid
s. This in turn might cause the wrong deck configuration to be selected when importing a deck whose subdeck is supposed to have a different options group than the parent.(Note that the exported deck config "contents" (intervals etc.) is that of the correct options group — it's just that UUIDs are the same...)
Usually, however, I expect it to be harmless. I'm mainly reporting it because I noticed this while debugging #116 and started worrying whether it (this issue) is caused by a flaw in CrowdAnki's "logic" (as noted, it isn't, it's just that we don't work around the way Anki creates new options groups). Hopefully, I'll save other people this investigation. :)
Solutions
I think that using the
deck_conf_did_add_config
hook (and automatically changing the uuid, if needed) could solve the problem. However, due to the low severity, I'll first try to deal with more urgent issues.Edit: The same issue holds for note models — when you clone a note model, the clone inherits the
crowdanki_uuid
of the original.The text was updated successfully, but these errors were encountered: