Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix actions that shouldn't happen while autosaving #1341

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

manongjohn
Copy link
Collaborator

While reviewing #1332, I noticed there is a potential for overlapping save operations under certain scenarios which could potentially result in file corruption. Additionally, #1332 suggests an undo operation was performed while an autosave was in progress. This could cause a crash when it tries to access something that may no longer exist.

I've added logic to internally flag when a save is in progress so that any additional calls to save while actively saving will wait until the flag is cleared.

Scenarios that should be covered by this fix

  • Timed autosave + suspended autosave due to active drawing or something
  • Timed autosave + manual save by user
  • Timed autosave + Undo/Redo

NOTE: It's hard to duplicate overlapping saving issues naturally. I mostly regression tested for normal saving and autosaving operations as well as a simple saving error (file locked) and ensuring T2D didn't completely freeze up.

@manongjohn manongjohn added the 1.4.1 Included in Version 1.4.1 label Jan 12, 2024
@artisteacher
Copy link
Contributor

Thanks for tackling this!

@manongjohn manongjohn merged commit 34d6ca6 into tahoma2d:master Jan 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.4.1 Included in Version 1.4.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants