Skip to content

Don't send invalid cards to dupe check#2267

Merged
Kuuuube merged 1 commit intoyomidevs:masterfrom
Kuuuube:no-empty-dupe
Dec 20, 2025
Merged

Don't send invalid cards to dupe check#2267
Kuuuube merged 1 commit intoyomidevs:masterfrom
Kuuuube:no-empty-dupe

Conversation

@Kuuuube
Copy link
Copy Markdown
Member

@Kuuuube Kuuuube commented Dec 18, 2025

Ankiconnect android blows up when we send it notes with a missing deckname or modelname. These notes are obviously invalid and do not need to be checked as a dupe. But the array indexes staying aligned is very important here.

Quick summary of this:

  1. Split the note info into invalid and valid but push a placeholder null to the invalid array wherever a valid index would be
  2. Check dupes using the valid array
  3. Fill in the nulls in the invalid array with the valid dupe checks

Skips dupe checking invalid notes and preserves the indexes.

Tested on desktop only but no reason this should perform differently on android. Inspecting the network tab this clearly does the job excluding invalids.

@Kuuuube Kuuuube requested a review from a team as a code owner December 18, 2025 17:18
@Kuuuube Kuuuube added kind/bug The issue or PR is regarding a bug area/anki The issue or PR is related to Anki integration platform/android-only The issue is android only labels Dec 18, 2025
@jamesmaa
Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Kuuuube Kuuuube added this pull request to the merge queue Dec 20, 2025
Merged via the queue into yomidevs:master with commit 92e733a Dec 20, 2025
19 of 30 checks passed
@Kuuuube Kuuuube deleted the no-empty-dupe branch December 20, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/anki The issue or PR is related to Anki integration kind/bug The issue or PR is regarding a bug platform/android-only The issue is android only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants