-
Notifications
You must be signed in to change notification settings - Fork 34
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
Unit-Testing with Coroutines results in "You may not call the store from a thread other than the thread on which it was created" #38
Comments
Interesting. Is this open source anywhere where I can pull it down? I will look into this. |
It is not open source, but I've created a simplified project which also reproduces the error :) |
@patjackson52 Do you had time yet to look into this issue? :) |
Thanks for pinging and the sample project @jennymolske. Looking into it now and working on a fix. It is a bug with 0.3.1. I would recommend going back to a previous version until I get the next release out (hopefully tomorrow or this weekend) |
@jennymolske PR is up for this issue. If your interested please review. Will likely merge & release tomorrow if no issues. |
* bugfix issue #38 enforce same thread * bump to v3.2
fix available in v0.3.2 |
Great, thank you :) Do you know when the new version will be available? |
It went live yesterday @jennymolske |
Hi,
we currently use your library in combination with Kotlin Coroutines and Flow. One of our middleware methods looks like this:
We wanted to test this (and the other functions) and wrote the following JUnit Test:
Unfortunately the test throws an error:
Exception in thread "UI @coroutine#3" java.lang.IllegalStateException: You may not call the store from a thread other than the thread on which it was created. This includes: getState(), dispatch(), subscribe(), and replaceReducer() This store was created on: 'UI @coroutine#2' and current thread is 'UI @coroutine#3' at org.reduxkotlin.CreateStoreKt$createStore$3.invoke(CreateStore.kt:50) at org.reduxkotlin.CreateStoreKt$createStore$7.invoke(CreateStore.kt:174)
I already tried lots of coroutine combinations to get rid of this issue, but no success. Do you have an idea how we can fix this?
(additional information): The exception doesn't appear in production, only in the test scenario.
Thanks for your help :)
The text was updated successfully, but these errors were encountered: