-
Notifications
You must be signed in to change notification settings - Fork 20
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
MdbxError(11) #60
Comments
I am not sure if it helps you to reproduce this issue, but in our case we're getting this error consistently once user uses a back arrow (instead of hamburger menu icon) on Android to close the app (goes to detached state) and then taps the app again so it starts again: isar#1068 (comment) |
I wrote a demo to reproduce this issue on an Android phone. When the app returns to the home screen while a database write operation is in progress but not yet completed, and then the app is reopened, this issue occurs. |
I discovered that adding a delay on launch before writing or reading to give the database time to open fully resolved the issue for me. Must be a data race from within the package |
Looks like I found a workaround too. The task is to prevent the app from going to the detached state after pressing 'back.' Add this to your Home widget:
I use a modal popup with the message 'Do you really want to close the app?' If the user presses 'close,' I call In this variant, the app never goes to detached state and there won't be any issues with MdbxError(11). However, there still could be issues with existing transactions, and you can add a function to await them before exiting UPD: it's better to use https://pub.dev/packages/flutter_exit_app instead of |
@Tr736 can I ask you if you added the delay before opening the database or before the first write/read operation. In my case I added a delay before the first opening of the DB of 300 ms and I am still seeing the error reported in Crashlytics. |
I’ve added the delay after opening and before the first write unfortunately this repo is pretty much dead and with the new flutter versions I’ve noticed a massive spike in cpu and memory allocations along with all the other issues we’ve experienced. we’ve decided to pull the database from our repo, which is a lot of work :( |
Steps to Reproduce
The Database is failing with an MdbxError(11) as shown in the logs. This bug is hard to reproduce. Personally, i have not encountered it in production yet, others have. Sometimes it occurs after hot reloading the app several times. It seems to be an Error in the Rust part of Isar and i have no clue how to look into that myself. Maybe you can.
There is an ongoing issue at the original Isar repository:
isar#1068 (comment)
Here are my logs:
Code sample
Take the counter app, add whatever IsarSchema and open it on running the App. Then hot reload the App a couple of times. I cannot guarantee, that this will produce the Error.
Details
The text was updated successfully, but these errors were encountered: