Wrong update of non-existing note

There is currently a silent error with https://ankiweb.net/shared/info/1566928056 and I believe that it would be nicer to throw a real error message instead of just ignoring the problem. Would help devs’ debugging I believe and also ensure that users saw that something went wrong.

To be specific, I used to create a note by taking an already existing note, changing its id and flushing it. That made a copy of the note keeping fields, tags, and even creation date if I didn’t change the id too much.

It seems it began to break with recent version. I do not speak rust, but I assume that the problem is that “flush” now call “update note” and that if the note does not already exists in the collection, the action does nothing.

I really believe that, at least a stdout message, should be welcome here.

Is there any way to create a note with a specific ID ? I was really looking forward being able to change the creation date of note. I fear it means that I need to do the change manually in the database if I can’t just use flush anymore, and I don’t know what would be the consequences

1 Like

This may change when it comes time to rework the undo handling, but that’s still a while off - for now you’ll need to have a new id allocated and then immediately update the note and its cards.