-
Notifications
You must be signed in to change notification settings - Fork 18
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
Writing to collection breaks synchronization and editing in Ankidroid #137
Comments
Hi @catherning. Thank you for this detailed writeup! So you are saying that you are stuck and cannot get the collection to synchronize anymore? I'm very sorry to hear about this! However, Once you're there, maybe make a copy of the current collection file and then replace the collection file with the latest backup. This should restore the state before Let me know if that gets you back to a working database/synchronization. |
This should be your backup file
Your database file |
Ah, but I just saw that you actually used an export/import workflow to get the changed notes into your main profile... So maybe you would restore the test collection, check that everything works there, and then do another export/import from test to your main profile? |
Hi @klieret, thanks for your quick reply! For now, I have no issues restoring to previous backups, as I do a manual backup by exporting in addition to those
I know the manipulation fonctions are still in alpha, I wanted to report this related issue. |
OK, I'm relieved that you restored everything to a working state. I believe these issues might be related to the "last modified" timestamps. Let me check. |
This reddit thread seems to talk about a similar problem. |
Thank you for looking into it! Indeed, it seems that I have a similar need and issue. But I thought forcing the sync would mark all the notes for sync "once and for all"? The thing is, after editing with |
Hi @catherning.
Indeed. This is why writing support with
This is my understanding as well: Having operations that require a forced sync happens (even when just using Anki). But you only need to do it once and then go back to normal.
This is definitely a bug. Actually, going back to your original report: You said you export and then import again, right? Could you produce a minimal example of the export file (only containing perhaps a single note) that triggers the issue? What's the format of the export?
Probably apkg, right? |
Hello @klieret, So, I have a few more details. On Ankidroid:
Other bugs I just got, using Ankiweb directly (to redo for confirmation):
I hope these details are helpful. Here's the collection with a single note. |
Thanks again for providing more information. Unfortunately, I cannot find time at the moment to work on this. I'm pretty sure we could figure this out by reading the Anki source and finding out what they do precisely when they write into the SQL database. I have marked the issue as |
I have seen multiple bug reports that turned out to be caused by this project. Please either fix the issue, or remove the broken functionality so that it doesn't create more work for us and the people using it. The issue appears to be that the notes table is being created without a primary key when .write() is called. |
Hi @dae. Thank you for reaching out, I'm very sorry to hear that my package has caused problems. I really appreciate Anki and certainly don't want to add additional work for you. As I currently don't have the time to work more on this and haven't found a volunteer so far, I will make the
Ah, that's very interesting. I still hope that this can be fixed in the future. Would it be OK to reach out with questions if more help with understanding the database internals was needed? |
Thank you for pushing out a fix quickly. Questions about the file format are best posted on forums.ankiweb.net, but I would recommend rather than directly reading/writing .anki2 files, you instead make use of Anki's Python API, as the file format was not written with external programs in mind. |
Hi,
First, thank you for this package! I wanted to edit notes in batch, I'm looking for different solutions, including developping my own Anki plugin, but Ankipandas looks like it could easily help me do my editing - this bug aside!
(For information, an example row value of selection["nfld_Winner"] is {{c1::Cadel Evans::who?}} won the {{c2::2011::year}} Tour de France. The extracted information are then 2011 and Cadel Evans respectively)
I hope this is clear enough!
The text was updated successfully, but these errors were encountered: