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

Ionic App Crashed when saving large array #153

Open
xsoul opened this issue Mar 12, 2020 · 4 comments
Open

Ionic App Crashed when saving large array #153

xsoul opened this issue Mar 12, 2020 · 4 comments

Comments

@xsoul
Copy link

xsoul commented Mar 12, 2020

I'm using this plugin in my ionic 4 project, my app will crash when trying to save large array (500++ elements) to ngxs state with async-storage-plugin (use ionic storage plugin example given). When i'm using the @ngxs-labs/storage-plugin which internally using localStorage and sessionStorage, the app is working fine without problem.

Any help will be highly appreciate. Thank you.
Error-snapshot

@marcjulian
Copy link
Collaborator

@xsoul can you provide a reproduction repository?

@xsoul
Copy link
Author

xsoul commented Mar 23, 2020

Sorry for late reply. May you kindly give me some guideline what kind of repository I should prepare? Thank you

@splincode
Copy link
Member

Simple reproduce where we can confirm your behaviour

@xsoul
Copy link
Author

xsoul commented Apr 24, 2020

I don't have the large json file, but I manage to make it work with Indexeddb, the Sqlite will crashed during the serialization in localForage._setItem method, the code below causing my entire vs code debugger freeze and then crash the app. No error found so I can't provide any detail error message.
dbInfo.serializer.serialize(value, function (value, error)

Another problem is, both indexeddb and sqlite will not persist the data, the data will being clean up after reboot application (android), I can see from Chrome devtools that the indexeddb is perfectly fill up with data, but after reboot app, the data will clean up.

The app work perfectly with ngxs storage plugin with localstorage (but can't support large amount of data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants