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

View.draws() never emits in API 25, does in API 28 #506

Open
DYJParker opened this issue Mar 19, 2019 · 1 comment
Open

View.draws() never emits in API 25, does in API 28 #506

DYJParker opened this issue Mar 19, 2019 · 1 comment

Comments

@DYJParker
Copy link

Current testbed app works fine on Pixel 3 and emulator both running API 28, but I had a critical bug appear when I tried it on a hardware tablet. Tablet was running API 25, so I spun up an equivalent emulator, and tracked the bug down to the fact that my UI changes go through a delaySubscription operator keyed to the .draws() of my custom view.

Between inserting doOnNext with logger methods into the stream going into the delaySubscription and adding similar doOnSubscribes to the state-stream coming in from the back end, it's clear that the `.draws() stream is simply never emitting on API 25.

Everything in the following executes on API 28, but on API 25 only the "setup in" and "Meta subscribed" logging extension functions are executed.

private fun setupInStreams() {
        logger("setup in")
        val delayStream =
            qenPage.draws()
                .doOnNext { iLogger("drawn", qenPage) }
                .delay(5, TimeUnit.MILLISECONDS)
                .doOnNext { iLogger("delayed", qenPage) }

        cd.addAll(
            vm.getTouchesOut()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe {
                    qenPage.drawSegment(it)
                },
            vm.getMetaOut()
                .doOnSubscribe { logger("Meta pre-subscribed") }
                .observeOn(AndroidSchedulers.mainThread())
                .delaySubscription(delayStream)
                .doOnSubscribe { logger("Meta subscribed") }
                .subscribe {
                    iLogger("Main activity received", it)
                    when (it) {
                        is MetaState.ClearCurrentPage -> qenPage.clearPage()
                        is MetaState.SelectedPage -> qenPage.drawPage(it.content)
                    }.exhaustive
                }
        )
    }
@JakeWharton
Copy link
Owner

JakeWharton commented Mar 22, 2019 via email

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

2 participants