Issue
When the server is not compatible, we manually call Manager.stop(), which disposes the database and these exceptions happen:
ProgrammingError: Cannot operate on a closed database. File "nxdrive/notification.py", line 516, in _newError File "nxdrive/notification.py", line 173, in send_notification File "nxdrive/engine/dao/sqlite.py", line 409, in insert_notification File "nxdrive/engine/dao/sqlite.py", line 130, in cursor
ProgrammingError: Cannot operate on a closed database. File "nxdrive/gui/api.py", line 405, in set_update_channel File "nxdrive/manager.py", line 449, in set_update_channel File "nxdrive/manager.py", line 390, in set_config File "nxdrive/engine/dao/sqlite.py", line 317, in update_config File "nxdrive/engine/dao/sqlite.py", line 130, in cursor
ProgrammingError: Cannot operate on a closed database. File "nxdrive/gui/api.py", line 303, in get_update_channel File "nxdrive/manager.py", line 445, in get_update_channel File "nxdrive/engine/dao/sqlite.py", line 340, in get_config File "nxdrive/engine/dao/sqlite.py", line 130, in cursor
Fix
We should call Manager.suspend() and introduce a new attribute Manager.restart_needed to:
- tell the GUI to not let the user click on "Resume"
- forbid DirectEdit