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

Storage throwing exception when store.json.unsupported file exists #80

Closed
Executus opened this issue Mar 17, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Executus
Copy link

During FileSystemStorage.Load, if the store.json fails to deserialize it is renamed to .unsupported:

catch (JsonSerializationException e)
{
        // Move the file to a .unsupported file
        // and start fresh
        File.Move(FilePath, FilePath + ".unsupported");
        Entries = new Dictionary<string, object>();
}

If it fails again in the future, File.Move will throw the following exception:

System.IO.IOException: Cannot create a file when that file already exists
at System.IO.FileSystem.MoveFile
at System.IO.File.Move
at WalletConnectSharp.Storage.FileSystemStorage.Load
at WalletConnectSharp.Core.Core.Initialize
at WalletConnectSharp.Core.Core.Start
at WalletConnectSharp.Sign.WalletConnectSignClient.Initialize
at WalletConnectSharp.Sign.WalletConnectSignClient.Init
@Executus Executus changed the title Storage throwing exception when .unsupported file exists Storage throwing exception when store.json.unsupported file exists Mar 17, 2023
@gigajuwels gigajuwels added the bug Something isn't working label Sep 26, 2023
@gigajuwels
Copy link
Contributor

This has been fixed as of version 2.1.0

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

No branches or pull requests

2 participants