-
Notifications
You must be signed in to change notification settings - Fork 221
updateNoteFields returns errorless but does nothing #82
Comments
I try this Action, and then it returns: {result: null, error: 'NoneType' object is not iterable} |
I met with the same issue , but the cause in my case is I got the wrong note id( an id doesn't exist at all).
|
Try adding |
I'm observing the same behavior with the latest master branch. |
After doing some debugging, it looks like the |
I should not I'm on Anki 2.1.11. |
Just tested this on 2.1.13 and it appears to work fine for me. Can you try running the unit test and see if that fails for you (check |
Ah, it appears it doesn't work when the note browser is open. If I close the browser and then update a note, I can open it again and view the updated note. |
The note browser probably resets the note to the previous value on close. |
That'd make sense; I wonder if there's a way to live-update in the browser. |
It works for me now, Thank you! |
I was struggling with the same issue with Anki 2.1.15 on Linux, and what @garrett-hopper says is correct: if the note browser is open then just running Some additional observations:
I wonder if this means that the update request is received but simply not shown in the note browser. And then when one closes the note browser it takes all the data from the note browser's view and overwrites the update -- effectively going back to the old value. @FooSoft Perhaps this is a bug in the Anki program itself? |
Could I suggest adding some clear warning in updateNoteFields's section of notes.md that having note browser would likely cause the note to not be updated even if the API returns a successful promise? I have a feeling first timer user and developer alike would be very tempted to keep browser gui open to handily see if the command works (which would backfire XD) |
Can I bump the request to add a warning to updateNoteFields in the README that having the GUI open causes it to not do anything? I just ran into this exact issue, ironically also writing a script to add example sentences to a vocabulary deck. Closing the GUI solved the issue though so thanks Garrett! |
Just wanted to mention that for anyone writing scripts using The order of API calls is the following:
Credits to this code in mpvacious for pointing it out in the comments. |
Perhaps it is case-sensitive and you should use |
I have been trying to write a program that inserts example sentences into a vocabulary deck using a few APIs, but have gotten hung up because
updateNoteFields
seems to do nothing. I can runnoteInfo
and get the note's information fine, but runningupdateNoteFields
on the same note ID seems to do nothing. The request also returns"error": null
despite clearly not following intended behavior.The text was updated successfully, but these errors were encountered: