lesnitsky / flutter_localstorage

📦 LocalStorage for Flutter
MIT License
301 stars 60 forks source link

FileSystemException: An async operation is currently pending #101

Closed lurongshuang closed 10 months ago

lurongshuang commented 11 months ago

FileSystemException: An async operation is currently pending, path = '/var/mobile/Containers/Data/Application/748AAD7F-7060-4E93-8E22-A899249CE487/Documents/account_level_5184182830088322.json'

localstorage: ^4.0.1+4

lurongshuang commented 11 months ago

@lesnitsky Can you help me take a look

Vollinator commented 10 months ago

@lurongshuang Try to use "await" when calling "setItem" like this:

await store.setItem(......);

felix-mittermeier commented 10 months ago

@lurongshuang Just using await inside the app is often not reliable in case of multiple parallel processes. I created a fork of this package and added the mutex (lock functionality) directly inside the code. Just switch to this modified version without any further code changes and the error is gone :-)

https://github.com/Ocell-io/flutter_localstorage

brenomenosso commented 9 months ago

@felix-mittermeier help me ?