Skip to content
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

[BUG]: Duplicate checks only detect recently exported cards, AnkiDroid API #13561

Closed
4 tasks done
arianneorpilla opened this issue Apr 6, 2023 · 4 comments
Closed
4 tasks done

Comments

@arianneorpilla
Copy link

arianneorpilla commented Apr 6, 2023

Checked for duplicates?

  • This issue is not a duplicate

What are the steps to reproduce this bug?

I'm the developer of a language learning app for Japanese called jidoujisho and recently I implemented duplicate checks for my app.

Users can create cards with my app, and I use the first field of a dictionary word for cards exported to check for duplicates.

To reproduce, you can look at my code for how I implement this in my project.

I understand that this is not a core AnkiDroid issue, but I am an API consumer so I hope this is the correct place to get support for this.

The function I rely on from the API:

public fun findDuplicateNotes(mid: Long, key: String): List<NoteInfo?> {

Native Android function call for duplicate check:
https://github.com/lrorpilla/jidoujisho/blob/afd2b2ba8f3da5fb33bb5af2f5dd53c4b1dd9000/yuuna/android/app/src/main/java/app/lrorpilla/yuuna/MainActivity.java#L157

How I call the Android method channel in my Flutter app:
https://github.com/lrorpilla/jidoujisho/blob/afd2b2ba8f3da5fb33bb5af2f5dd53c4b1dd9000/yuuna/lib/src/models/app_model.dart#L1784

I know it might be unreasonable to ask a developer to install my application so they can see the behaviour but that would also be a fast and sure way to reproduce, latest release is as linked
https://github.com/lrorpilla/jidoujisho/releases/tag/2.6.2

I will probably edit with more details as I go if required

Expected behaviour

I expect that duplicate checks return all notes for a given model ID and first field key.

Suppose Card A is a card with the first field value A

I make Card A
App installed
Check for duplicates
Card A is detected
Export a Card A with my app
Card A is detected

Actual behaviour

For some reason, duplicate checks only work for recently exported cards from after my app is installed. Cards made before my app checked for duplicates are NOT included and returned in the duplicate check.

Suppose Card A is a card with the first field value A

I make Card A
App installed
Check for duplicates
Card A is not detected
Export a Card A with my app
Card A is detected

Debug info

AnkiDroid Version = 2.15.6

Android Version = 13

Manufacturer = Google

Model = Pixel 6 Pro

Hardware = raven

Webview User Agent = Mozilla/5.0 (Linux; Android 13; Pixel 6 Pro Build/TQ2A.230305.008.E1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36

ACRA UUID = f8260709-3407-46a0-9e17-3238ee022ea8

Scheduler = std

Crash Reports Enabled = true

DatabaseV2 Enabled = true

(Optional) Anything else you want to share?

Again, I understand this is not an issue affecting AnkiDroid users but I hope I can get help getting this resolved -- I am willing to debug on my end and give more information if requested as I know the developers here aren't involved with my project,

I would really like to know why this behaviour is happening

Research

  • I am reporting a bug specific to AnkiDroid (Android app)
  • I have checked the manual and the FAQ and could not find a solution to my issue
  • (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
@arianneorpilla
Copy link
Author

arianneorpilla commented May 3, 2023

Hi @mikehardy and @david-allison, sorry for the ping but I was wondering if you could take a look at this issue?

I'm not sure if I'm doing something wrong in my own end implementing this or if it's an AnkiDroid API issue. Thought I would follow up as my own users are pressing me about this.

@arianneorpilla
Copy link
Author

I tried using the Rust backend and upgraded to the latest alpha and I have the same issue.

@arianneorpilla
Copy link
Author

arianneorpilla commented May 3, 2023

It seems that exporting the cards in, deleting, then importing them back in has made it work, but this was a strange thing to have to do, and I still want to learn what's going on if possible.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Aug 1, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant