Skip to content

Conversation

@steve-the-edwards
Copy link
Contributor

No description provided.

steve-the-edwards and others added 2 commits November 11, 2025 11:03
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
"Collection dispatch should happen on the lifecycle's dispatcher."
withContext(collectionContext) {
require(Looper.myLooper() == Looper.getMainLooper()) {
"Collection dispatch should happen on the main thread!"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/should/must

* @param [collectionContext] additional [CoroutineContext] we want for the coroutine that is
* launched to collect the renderings. This should not override the [CoroutineDispatcher][kotlinx.coroutines.CoroutineDispatcher]
* but may include some other instrumentation elements.
* launched to collect the renderings, can include a different dispatcher - but it should be
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested wording: "can include a different dispatcher - but we verify that it's a main thread dispatcher" And maybe explain why this restriction exists (naively I thought all of this stuff was immutable so it'd be safe to access them from any thread)

unoriginal.show(BScreen(), env)
}

@Test fun usesLifecycleDispatcher() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any test coverage now? If you took out the withContext statement and just ran the block directly would any test fail? (If not, I think we should test that)

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

Successfully merging this pull request may close these issues.

3 participants