electron-userland / electron-json-storage

:package: Easily write and read user settings in Electron apps
1.43k stars 79 forks source link

Invalid Data in single JSON object causes fatal error in getAll and getMany #54

Closed andrewjaykeller closed 7 years ago

andrewjaykeller commented 7 years ago

Using getAll is causing fatal error:

Invalid data

Problem is I have 260 json objects an no idea which to delete or clean.

Also I see .DS_Store is being returned as a key, i wonder if this is causing problems.

jviotti commented 7 years ago

Hi @aj-ptw ,

I just sent a PR that makes the "Invalid data" error include the actual problematic object: https://github.com/jviotti/electron-json-storage/issues/55. Can you install that branch to see what object is causing the error, so we can eventually fix the root cause?

jviotti commented 7 years ago

I'll send another PR to filter .DS_Store from the list of keys.

jviotti commented 7 years ago

See https://github.com/jviotti/electron-json-storage/issues/56. Let me know how that goes!

andrewjaykeller commented 7 years ago

@jviotti hey sorry not sure why i was not getting notifications from this thread! Hey awesome work! Unfortunately I accidentally nuked my entire cache while trying to find the problematic object so ah nope can't track the object down anymore :)

jviotti commented 7 years ago

No worries! I published 3.0.2 with the fixes. Upgrade to that version, and let me know if the problem ever appears again.

andrewjaykeller commented 7 years ago

@jviotti great work. thanks