Skip to content

Fix Autosave "changed by another application " Spam #2072

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

thecoolwinter
Copy link
Collaborator

@thecoolwinter thecoolwinter commented Jun 23, 2025

Description

Fixes an issue where a file save would not correctly update the CodeFileDocument's metadata when saving. This caused scheduled autosave operations to fail with a false positive 'changed by another application' error.

To fix, I'm allowing NSDocument to handle the actual file system operation, rather than writing the data like we were before. I've kept the extra logic in the overridden save method to fix broken directories. There's no good reason to move the file saving operation out of NSDocument, since that subclass likely handles it better than we do with an atomic data write.

I've also moved autosave scheduling out of UI and into the document class.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

N/A

@thecoolwinter thecoolwinter merged commit 6619d16 into CodeEditApp:main Jun 24, 2025
3 of 4 checks passed
@thecoolwinter thecoolwinter deleted the fix/autosave-spam branch June 24, 2025 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 File Saving Throwing "Modified By Another Program" Error
3 participants