putString when wrapped with Completable.fromFuture() seems to run immediately
Closed this issue · 4 comments
akvashi commented
Describe the bug
putString when wrapped with Completable.fromFuture() seems to run immediately. Verified via debugger.
Maybe be specific to the instance when checking for said key before writing to SimpleStore
To Reproduce
Code Setup:
val setValue = Completable.fromFuture(simpleStore.putString(key, value))
val checkKeyFirst = Single.fromFuture(simpleStore.containsSingle(key))
checkKeyFirst.flatMapCompletable { isSet ->
if(isSet){ throw IllegalStateException() } else { setValue }
}
Expected behavior
Value should only be placed in SimpleStore when Completable has been subscribed to
Smartphone (please complete the following information):
- Device: various
- OS: Android 10
akvashi commented
I realize after writing this that this maybe an issue within Rx. Either way I think its important to highlight the issue in case anyone else runs into it.
kurtisnelson commented
If a failing unit test can be written, that would be great.
mcthekreator commented
a failing unit test can be written and called in a separate project