Merged
Conversation
abdnh
approved these changes
Mar 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both, the AnkiHub add-on and the AnKing note types add-on, can update the fields of note types. We need to prevent issues where one add-on adds a field, and the other removes it, leading to loss of note fields contents for that field.
We can do this by changing the add-ons so that they only add fields, but don’t remove them.
The add-ons should just add missing fields and ignore extra fields.
This will also have the effect that users will be able to add extra fields to the note type, without the fields getting reset during sync.
AnkiHub add-on PR: AnkiHubSoftware/ankihub_addon#1117
Related issues
https://ankihub.atlassian.net/jira/software/c/projects/NRT/boards/41?selectedIssue=NRT-34
Resetting note type with extra fields
You can also try removing a field which is on the note type (not only locally) and see that it gets added.
Additionally, you can position an extra local field after the ankihub_id field of an AnkiHub version of an AnKing note type, then reset. The new local extra field should be moved before the ankihub_id field.