Skip to content

Don't use AnkiConnect's duplicate check #641

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

Open
ale18V opened this issue Mar 5, 2025 · 0 comments · May be fixed by #642
Open

Don't use AnkiConnect's duplicate check #641

ale18V opened this issue Mar 5, 2025 · 0 comments · May be fixed by #642

Comments

@ale18V
Copy link

ale18V commented Mar 5, 2025

So I was trying to create a custom regex for a note type. Although the regex was correctly matching I couldn't get the plugin to generate notes using that regex. I assumed that the plugin was maybe adding some flags or handling it in some weird way so I kept trying to switch up the regex but without any success.

So I ended up checking the obsidian's console and I saw that my note was indeed matching but was not being created: Failed to add note { Note JSON } due to error cannot create note because it is a duplicate.
I looked into it and found that the error was due to AnkiConnect as it's being called with:

{
  "options": {
    "allowDuplicate": false,
    "duplicateScope": "deck"
  }
}

It appears that AnkiConnect checks whether a note is duplicate or not by comparing the main field of the note. While this is arguably not a good idea on their side, I believe we should set allowDuplicate" to true` as this hidden behaviour is probably not what most users want. At least for me, it did cause much headache.

I'm opening a PR for this issue if it welcome.

@ale18V ale18V linked a pull request Mar 5, 2025 that will close this issue
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 a pull request may close this issue.

1 participant