"Show Duplicates" not working

Anki only checks the first field when detecting duplicates; the Thai field.
I’m not able to reproduce the issue. I suggest disabling add-ons temporarily as described in When problems occur and testing again.

I only use one plugin: Hierarchical Tags 2
Steps I tried to fix the problem:

  1. Disable plugins in the add-ons screen
  2. Restart Anki holding shift
  3. Installed latest beta (Version ⁨2.1.36 (c1d15a8e)⁩)
  4. Check database button in the tools menu
  5. Restart my computer
  6. Switch to a new profile and sync my collection with ankiweb
  7. Switch to a new profile and import a backup of my collection
  8. Clean install of anki stable 2.1.35 (including deleting appdata folder which contains my profile)
    (Clean install of beta 3 didn’t work as you can see in the “Anki 2.1.36 Beta” topic)
  9. Clean install of the stable 2.1.35 alternate version

And the steps I take to reproduce this problem:

  1. I already have a card in my deck as described in my above post
  2. I add a new card and type in the first field called “Thai”: เรียก
  3. Anki colors the field red and shows me the “Show Duplicate” button
  4. Clicking “Show Duplicate” brings me to the card browser with “dupe:1432470439634,เรียก” in the search field, but the card browser is empty
  5. Searching for “เรียก” shows me the correct card in the browser

I actually think there’s a problem with my collection because I can get show duplicates to work with a new profile and not importing my collection.

Would you be able to test it if I share my collection with you?
My collection as *.apkg: https://www.dropbox.com/s/y63nlqpbgtp0a4e/xunobulax_collection.apkg?dl=0
My collection as *.colpkg: https://www.dropbox.com/s/mvm9g2ndphwre6j/xunobulax_collection.colpkg?dl=0

1 Like

Thanks for uploading your collection. I was able to reproduce the issue! This looks like a bug.
It happens when the sort field is set to something other than the first field. It’s set to English in your case.

@dae, It seems different parts of the code have different assumptions about whether to check the first field or the sort field. Checking the first field is the expected behavior according to the manual.
Both of note_is_duplicate_or_empty and showDupes work with the first field, but write_dupes works with the sort field. I assume write_dupes is in the wrong here?


Yep, you’re right - it looks like I overlooked the sort field != idx 0 case when writing this code. We probably need to extract field_at_index(flds, 0) for each row that matches the checksum, strip HTML and compare, then create a new query based on the matching IDs.

1 Like