WARNING!!

Discussion and help for Easy Save 3
Post Reply
krolldk
Posts: 25
Joined: Sun Jun 02, 2019 11:15 am

WARNING!!

Post by krolldk »

I'm sorry, but this goes beyond incompetence.

I invite everyone to try the following:

Code: Select all

public void TrivialTest()
    {
        ES3File myFile = new ES3File("Filename.es3",false);
        myFile.Save<int>("myKey", 0);
        myFile.Sync();
    }
Run this once, and you get a file named Filename.es3 in your default directory
(typically something like users/yourname/AppData/LocalLow/somecompany/someapp/ )
Find the file, and open it in notepad or similar. Content of the file should now be:
{"myKey":{"__type":"System.Int32","value":0}}
Stop execution. Change line 3 above to:
myFile.Save<int>("myKey", 1);
run again, and reopen the file from before. Content is now:
{"myKey":{"__type":"System.Int32","value":1},"myKey":{"__type":"System.Int32","value":0}}
So. instead of overwriting the value of myKey (as stated in the documentation), a new key-pair value has been added to the file. Presumably, if you read the value back from the file, you're fine, you get the latest value because it's the value you find first, but each time. EACH TIME, you try to overwrite a value, you will instead APPEND the value to the file.

I wouldn't be so pissed off, if this was an obscure usecase, but this is CORE functionality. it is literally the MOST central functionality easysave provides, and the implementation is insane. That makes me loose ALL trust that the remainder of easy save is safe to use.
Combined with the issues I've been having with cloudsave, I unfortunately must conclude that I am out of here, and I recommend anyone using easysave for anything non-trivial to check ALL your assumptions about what Easy save is doing for you.
krolldk
Posts: 25
Joined: Sun Jun 02, 2019 11:15 am

Re: WARNING!!

Post by krolldk »

First of all: My apologies to Joel and the team for my harsh language.

It turns out that the problem is ONLY for files created with no synching to local file (as in my example above). Joel tells me that this was intended behaviour, but that maybe it shouldn't be :-) In short: The problem probably is much smaller than I thought, but still a problem, and it will apparently be solved quick-ish.

Thanks for the good work!
Post Reply