[PlatformToolkit] Save data overwrite issue on Editor and PC with local saving

Hello!

I was just trying with Platform Toolkit Save System. Noticed, with Editor and PC, which uses LocalSavingSystem, I am facing issue with overwrite when I want to replace a save data of less length then the current data length.
For example:
Save file has following content - {"Name":"Abcd", "Number":7}

Now if we resave with the content with new save data - {"Name":"", "Number": -1}

We get parsing error when loading because, the file would have been corrupted because of partial replace - {"Name":"", "Number":-1}":7}

When investigated, we found the extra length from previous file isn’t getting truncated.
On further investigation, calling stream.SetLength(data.Length) in SolidZipArchiveFile.cs after line 60, fixes this issue as the extra length from previous save gets truncated.

Following is my Save function call setup:


Data Serializer is just the default Unity serializer.

Is this issue known? Or is there something else that has to be called for complete file overwrite in Platform toolkit save APIs?

Thanks!

Hi SindhuraRaoS,

Thanks for letting us know about this issue. I can confirm that it’s a known issue and we have a fix for it already. It will be in the next release which addresses lots of issues like this one.

Thanks!

Thanks for the update @thomh_unity. Looking forward to the update :slightly_smiling_face: