Skip to content

autosave#2189

Draft
colin-i wants to merge 2 commits into
PintaProject:masterfrom
colin-i:autosave
Draft

autosave#2189
colin-i wants to merge 2 commits into
PintaProject:masterfrom
colin-i:autosave

Conversation

@colin-i

@colin-i colin-i commented Jun 14, 2026

Copy link
Copy Markdown

Summary

This PR introduces an experimental autosave mechanism intended to reduce data loss in case of application instability or crashes (observed on Raspberry Pi builds running Ubuntu-based source builds).

The system periodically exports open documents to temporary .ora autosave files and cleans them up on normal application exit.

Motivation

During testing on Raspberry Pi environments, I encountered occasional crashes leading to loss of unsaved work. This change is an initial mitigation step to improve recovery of work in progress.

Current Behavior

  • Autosave runs at a configurable interval (autosave-interval)
  • Only exports documents that are marked as modified (IsAutosaveDirty)
  • Generates rotating autosave files per document
  • Cleans up autosave files on normal application exit (StopAutosave)

Implementation Notes

  • Extended Document with lightweight autosave tracking state
  • Integrated autosave trigger into DocumentHistory
  • Added periodic GLib-based autosave timer in WorkspaceManager
  • Temporary .ora export files are written per document
  • Basic rotation is supported via configurable file count
  • Autosave state is reset after each successful export

Limitations / Known Issues

  • This is an experimental system and may be refined further
  • No recovery UI is included yet (manual file inspection required)
  • File rotation logic is simple and may be improved
  • Additional validation and edge cases may be addressed in follow-up commits

Future Work

  • Investigate crash cases observed during testing (Raspberry Pi)
  • Improve robustness of autosave triggering conditions
  • Add recovery flow on application startup
  • Potentially refine file rotation and storage strategy

Follow-up

I will continue investigating the crash scenario to identify whether there is a reproducible issue. Based on findings, I will return with additional fixes or refinements to both stability and autosave behavior.

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.

1 participant