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

Fix newer notes incorrectly being skipped when importing successive exports #3693

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

iamllama
Copy link
Contributor

@iamllama iamllama commented Jan 7, 2025

Related? https://forums.ankiweb.net/t/update-notes-if-newer-only-works-one-time/52064

Fixes the "skipped notes when importing" issue in #3589

Let's say someone exports a deck X as an apkg (1), modifies it, exports it again (2), modifies it, exports it again (3)
And on a new profile: imports apkg 1, imports apkg 2, and tries to import apkg 3

Currently, when existing notes are updated while importing an apkg (2), the mtime is set to the time of the import.

This means that the notes in apkg 3 are now considered to be older than existing notes, and are skipped when trying to import it.

This is incorrect behaviour, since the user didn't manually modify any notes after each import.

With this change, the incoming note's mtime is preserved to allow importing successive exports

@dae
Copy link
Member

dae commented Jan 9, 2025

@RumovZ any thoughts? I can't recall if the mtime bump was something deliberate and required, or just a byproduct of the existing update_note() implementation

@iamllama changes look good on my end, and thanks for tackling that clippy todo while you were there!

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 this pull request may close these issues.

2 participants