Skip to content

Conversation

SuuperW
Copy link
Contributor

@SuuperW SuuperW commented Jul 13, 2025

Most file writes now use a new system that allows for error detection and handling. (includes movies, config file, and all tools)
When an exception occurs, a message box appears alerting the user. If there is an exception while doing a save-on-close, the user is given the option to try again, skip saving, or cancel closing. (Includes a bug fix where an existing dialog offering the cancel option did not actually cancel.)

Addresses #4258.

Fixes an issue where the CheatList was being forcibly autosaved when closing a game, ignoring the autosave config option.

Changes behavior when saving the config file fails. Previously it would silently fail (and report success if "saved" via the menu item), now it has the same error handling as other updated file writes. The silent fail seems to have been intended to allow using a read-only config file. If we want to bring this back, I suggest making a config option to not save on close instead. As-is, a read-only file will still work you just have to click "No" after closing EmuHawk when it tells you it can't save the config file.

Check if completed:

Copy link
Member

@YoshiRulz YoshiRulz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better I/O handling has been sorely needed for a while. I suspect the .tasproj corruptions will end with this.

@SuuperW SuuperW force-pushed the dot_saving branch 2 times, most recently from fde3481 to 0798074 Compare July 14, 2025 07:42
@SuuperW
Copy link
Contributor Author

SuuperW commented Jul 14, 2025

Highlights of force push:

  1. Added constraint to FileWriteResult and .editorconfig rules to enforce compliance.
  2. Re-did some closing and disposing stuff and order of things to make it work in all situations that I could think to test. Including a new "Abort" mechanism.

@SuuperW

This comment was marked as outdated.

@SuuperW SuuperW marked this pull request as draft July 14, 2025 19:11
@SuuperW SuuperW changed the title Handle exceptions while writing a movie file Handle exceptions while writing to files Jul 22, 2025
@SuuperW

This comment was marked as outdated.

@SuuperW SuuperW marked this pull request as ready for review July 22, 2025 08:12
@SuuperW
Copy link
Contributor Author

SuuperW commented Sep 4, 2025

I believe this is ready for merge. See edited OP for notes on some behavior changes.

YoshiRulz

This comment was marked as outdated.

@SuuperW
Copy link
Contributor Author

SuuperW commented Sep 7, 2025

Removed ISaveRam refactor.

@YoshiRulz YoshiRulz added App: EmuHawk Relating to EmuHawk frontend Meta Relating to code organisation or to things that aren't code labels Sep 26, 2025
@SuuperW
Copy link
Contributor Author

SuuperW commented Oct 4, 2025

Are there any reasons to not merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: EmuHawk Relating to EmuHawk frontend Meta Relating to code organisation or to things that aren't code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants