vladimiry / ElectronMail

Unofficial ProtonMail Desktop App
GNU General Public License v3.0
1.49k stars 96 forks source link

Windows App Completely Broken - Presented with this Upon Startup #544

Closed cww032992 closed 2 years ago

cww032992 commented 2 years ago

Unhandled Error SyntaxError: Unexpected end of JSON input at JSON.parse () at ReadStream. (C:/Users/Carter/AppData/Local/Programs/ElectronMail/resources/app.asar/app/electron-main/index.cjs:92437:31) at ReadStream.emit (node:events:526:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Readable.push (node:internal/streams/readable:228:10) at node:internal/fs/streams:275:14 at FSReqCallback.wrapper [as oncomplete] (node:fs:660:5)

cww032992 commented 2 years ago

I'd used a dozen (at least) prior builds, all on Win11 64-bit. The latest update is what prompted this bug.

vladimiry commented 2 years ago

Remove/rename the database-session.bin from the settings folder. If the issue is still there, do the same with database.bin file too.

cww032992 commented 2 years ago

Hi Vlad - your first suggestion worked perfectly. Truly appreciate the response time here - sorry if my description was a bit harsh. Thank you so much! Please consider this resolved.

vladimiry commented 2 years ago

There is an atomic write implementation which is supposed to prevent the data corruption on abnormal program exit. But this implementation appears to be flawed. Maybe at some point I will replace the storage with a real portable database, like sqlite.

cww032992 commented 2 years ago

I’m glad I could put it on your radar.

For what it’s worth everything’s worked flawlessly for me until this one small bug.

On Thu, Aug 11, 2022 at 4:33 PM, Vladimir Yakovlev @.***> wrote:

There is an atomic write implementation which is supposed to prevent the data corruption on abnormal program exit. But this implementation appears to be flawed. Maybe at some point I will replace the storage with a real portable database, like sqlite.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

vladimiry commented 2 years ago

After a brief review, added some tweak to the local store serializer. Hope this improves stability in the next release.