Skip to content
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

putString when wrapped with Completable.fromFuture() seems to run immediately #64

Open
akvashi opened this issue Oct 28, 2019 · 3 comments

Comments

@akvashi
Copy link

akvashi commented Oct 28, 2019

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
Copy link
Author

akvashi commented Oct 28, 2019

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
Copy link
Contributor

If a failing unit test can be written, that would be great.

@mcadamsx
Copy link

a failing unit test can be written and called in a separate project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants