Skip to content

App crash recovery - #76

Merged
zrgt merged 3 commits into
rwth-iat:developfrom
thammel:feat/app-crash-recovery
Jul 9, 2026
Merged

App crash recovery#76
zrgt merged 3 commits into
rwth-iat:developfrom
thammel:feat/app-crash-recovery

Conversation

@thammel

@thammel thammel commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This pull request implements a robust crash recovery system for the editor, ensuring that unsaved changes are not lost in the event of an unexpected crash. The main changes introduce automatic recovery file management, prompt users to restore unsaved work, and ensure cleanup of recovery data after successful saves. Additionally, it improves exception handling to trigger recovery logic on crashes.

Crash Recovery System:

  • Added a mechanism to auto-save recovery files for open packages when the application crashes, and prompt the user to restore unsaved changes on the next startup. This includes functions to find, write, and delete recovery files, as well as logic to remap recovered files to their original paths. (aas_editor/editorApp.py, aas_editor/package.py, aas_editor/utils/recovery.py, aas_editor/settings/app_settings.py, [1] [2] [3] [4] [5]

  • Ensured that recovery files and associated metadata are deleted after a successful save, preventing unnecessary accumulation of recovery data. (aas_editor/treeviews/treeview_pack.py, aas_editor/treeviews/treeview_pack.pyR655-R658)

Exception Handling Improvements:

  • Enhanced the global exception hook to allow registering a crash callback, which is now used to trigger saving of recovery files when an unhandled exception occurs. This ensures unsaved data is preserved even if the app crashes unexpectedly. (aas_editor/utils/exceptionhook.py, [1] [2] [3]

Other Improvements:

  • Refactored imports and settings to support the new recovery system, including the introduction of a constant RECOVERY_DIR for storing recovery data. (aas_editor/editorApp.py, aas_editor/settings/app_settings.py, [1] [2] [3] [4]

These changes significantly improve the reliability of the editor by safeguarding user data against crashes and providing a user-friendly recovery experience.

claude and others added 3 commits June 11, 2026 11:38
When an unhandled exception occurs, the app now saves each open package
to a recovery file in the settings directory. On the next launch, if a
recovery file is found for a previously opened file, the user is asked
whether to restore the auto-saved version or discard it and open the
original. Recovery files are cleaned up after a successful manual save.

- aas_editor/settings/app_settings.py: add RECOVERY_DIR constant
- aas_editor/utils/recovery.py: new helper to scan for recovery index files
- aas_editor/package.py: add write_recovery(), delete_recovery(), recovery_path()
- aas_editor/utils/exceptionhook.py: activate hook, add set_crash_callback()
- main.py: uncomment exceptionhook import so hook is registered at startup
- aas_editor/editorApp.py: register crash callback, prompt user to restore on open
- aas_editor/treeviews/treeview_pack.py: delete recovery files after successful save

https://claude.ai/code/session_01UFxYCRhX5pM18utUMv55rP
…ng delete_recovery_file function and updating related methods
@zrgt
zrgt merged commit 58501fc into rwth-iat:develop Jul 9, 2026
1 check passed
@zrgt zrgt mentioned this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants