Regression: Avoid corruption of config.json on unexpected shutdown

Unexpected shutdowns (e.g. OS crash) will cause config.json to become corrupted. I believe this is because Mailspring keeps it open for R/W axis, so it becomes corrupted if Mailspring doesn’t shut down properly.

The client should behave in a way that is robust against this issue.


(Originally posted by brandondube on GitHub.)

It seems this issue is related to the ones mentioned by @ccc5vd. This happened before on Nylas, detailed here and the fix was reviewed by @bengotow, here.

If this is a regression from Nylas, propagated to Mailspring, maybe we already have a solution.


(Originally posted by paulocoghi on GitHub.)

Duplicate Issues:

Joined, as explained by CodeMouse92

1 Like

Is there any progress on this?

Still happening, it would be nice to have this fixed

1 Like

I’ve met this issue as well. PC crashed, after reboot Mailspring complains about invalid config.json. I’m quite surprised by this. I did not do any change to the configuration that could have caused a bad write on the file so how can it even be corrupted?
Would be nice if there was an easier recovery than having to reconfigure all my mail accounts.
There seems to be no backup config file? It would be easy to reinstate the previous config if I just had to put a bak file into place. There are some config.json.local-83e44326-9244.bak files and similar in the config folder, but they’re all empty.