-
Notifications
You must be signed in to change notification settings - Fork 405
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
Bad State No element when putting a Map into a Box #50
Comments
On which device does this error happen? |
What I believe happens: Hive can for some reason not write to the box file (not necessarily a bug in Hive). It then reverts the key transaction to be in sync with the disk. This operation fails (certainly a bug). I'll try to find the reason. Thanks for reporting. If you find any more information or even a way to reproduce this, please share it here 👍 |
Thanks. This is being tested on an iOS simulator. It was consistent in my code, which is available at the repo I linked to , however, I removed the class I was using it in because it wasn't necessary for the app. I can point you to the previous commit if you'd really like to see it in action |
Thanks. This is being tested on an iOS simulator. It was consistent in my code, which is available at the repo I linked to , however, I removed the class I was using it in because it wasn't necessary for the app. I can point you to the previous commit if you'd really like to see it in action |
That would be really helpful... |
Here ya go. If I'm being too vague, let me know please. I'll help where I can |
Thanks for your help, I'll try to reproduce it... |
Sorry this was a bigger problem but it is now fixed with |
Thanks! |
@leisim Do we need to clone the repo to get this fix? |
No you can use version |
when i try to write this code in flutter using hive with latest versions. Product? product = _products.firstWhere((product) => product?.id == productId, orElse: () => null); i am getting error like this Unhandled Exception: type '() => Null' is not a subtype of type '(() => ApiLogs)?' of 'orElse' |
Stacktrace
Steps to Reproduce
Not sure how. It only happens when the app starts, a box is opened and written to quickly. If I put a breakpoint and it pauses, then when it resumes, the error doesn't show up
Code sample
link to repo: https://github.com/ThinkDigitalSoftware/tavern
Image of the frame, just in case you can grab something from it
Version
Flutter 1.10.1 • channel dev • https://github.com/flutter/flutter.git
Framework • revision ce45c2d3e6 (8 days ago) • 2019-09-06 20:11:41 -0400
Engine • revision b9ce2500d9
Tools • Dart 2.5.0 (build 2.5.0-dev.4.0 be66176534)
Hive version: 1.0.0
The text was updated successfully, but these errors were encountered: