Navigation

    Migaku Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Crash when sending data to an existing note + a temporary fix

    Migaku Anki Addon
    1
    1
    13
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vycton last edited by Vycton

      The editor.loadNote() call near the end of the _handle_data_from_card_creator function in migaku_connection/card_creator.py causes a complete crash that only prints Trace/breakpoint trap (core dumped).

      Looking into the editor.loadNote() function it seems to generate some JS code to refresh the editor webview. I initially thought this JS code might be getting messed up somehow, so I inserted some log statements into it using the editor_will_load_note hook. However, the crash seems to happen before the JS code is evaluated. The JS code is successfully generated and evaluated when opening the editor and selecting a note. The crash only occurs during the Migaku addon's editor.loadNote() call, even after I modified the addon code so that the JS code would be identical.

      What it is precisely that happens between the editor_will_load_note hook and the JS code being evaluated, and in what way it is different when the addon calls the editor.loadNote() is a bit too much for me to figure out right now.

      As a temporary solution I simply replaced the section marked with # TODO: Refactor with a simple call to aqt.mw.col.update_note(note). This saves the data (as long as the target field is not currently in focus) and prevents the crash, but does not update the UI.

      I am on Anki version 2.1.63 and Addon version 0.2.5

      1 Reply Last reply Reply Quote 0
      • First post
        Last post