-
-
Notifications
You must be signed in to change notification settings - Fork 932
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
BorrowMutError with async block event handler on Android #3464
Comments
I enabled
Note: the lines don't match with the lines on github as I added some code for debugging. The following line holds the borrow: dioxus/packages/core/src/scope_context.rs Line 353 in c2952a7
While we try to get the borrow here: dioxus/packages/core/src/tasks.rs Line 288 in c2952a7
It's not clear why these two locations can conflict as the borrow is only held for a single modification. However, when printing the current thread id via
in these two locations we see:
namely that the RefCell is access from two different threads. 😮 This shouldn't be possible, so I'm not sure what is going on here. 🤯 |
Note: On MacOS both locations are only accessed from the same thread, which is why we may not be running into this error. |
Might be related to: tauri-apps/wry#1379 |
Problem
When typing on Android one sometimes runs into BorrowMutError. I was not able to reproduce this on MacOS yet, only on Android via the emulator (which may also be connected to execution via the emulator being slower).
Steps To Reproduce
Steps to reproduce the behavior:
The exact error is:
Link to the relevant code:
dioxus/packages/core/src/tasks.rs
Line 288 in c2952a7
When this error occurs there's also a second error in the log:
The full log is:
Expected behavior
No panic.
Screenshots
BorrowMutAndroidTyping1080.mp4
Environment:
The text was updated successfully, but these errors were encountered: