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

Implement error handling for save data unserialization. #3270

Conversation

EliteMasterEric
Copy link
Contributor

FlxSave.status will now be set to ERROR(e) in the event that haxe.Unserializer encounters an error.

Partially resolves #3269 (still requires the application to query for an error and resolve the issue itself and I'm not sure of any good way to fix issues with the Unserializer).

@Geokureli Geokureli added this to the 5.9.0 milestone Nov 1, 2024
@Geokureli Geokureli added the Bug label Nov 1, 2024
@Geokureli
Copy link
Member

Geokureli commented Nov 5, 2024

can i get an example of how to trigger this issue?

@Beelijah
Copy link

geokureli you can download versions v0.5.2 and v0.5.0 of friday night funkin (game based in haxeflixel), and you can run v0.5.2.

then, complete a song in 0.5.2. now launch 0.5.0.

boom, save data wiped. gone. forever. overwritten. destroyed.

@Geokureli
Copy link
Member

Geokureli commented Nov 13, 2024

Is there a simpler way to reproduce this? Preferably a small test state, that manually saves outdated, raw serialized data, and then loads it via FlxSave:

  1. I'm going to have to test this dozens of times
  2. I want to test this via breakpoints and debugging tools, not by watching a game crash
  3. I'd like to make a unit test that checks for it
  4. I want to better understand what causes it

@Beelijah
Copy link

oh idk then, my brain smaller than a lays potato chip

@AbnormalPoof
Copy link

AbnormalPoof commented Nov 14, 2024

Is there a simpler way to reproduce this? Preferably a small test state, that manually saves outdated, raw serialized data, and then loads it via FlxSave:

  1. I'm going to have to test this dozens of times
  2. I want to test this via breakpoints and debugging tools, not by watching a game crash
  3. I'd like to make a unit test that checks for it
  4. I want to better understand what causes it

AFAIK The issue Friday Night Funkin’ had in FunkinCrew/Funkin#3679 was due to an enum value that wasn’t present in older versions. So I think it’s simple as making a save with an enum value, and then recompiling the project without said enum value. (The save data will likely fail to parse since the project can’t find the enum that’s referred to in the save data)

@Geokureli
Copy link
Member

Closing, merged #3286

Thanks for laying the foundation, here

@Geokureli Geokureli closed this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save data can get completely overridden if unserialization fails
4 participants