Consider removing `Unconfined` dispatcher as default `CoroutineContext` for `ComposeScene` creation
I am standing up Compose UI on a new target, and was surprised to see Dispatchers.Unconfined as the default value for the CoroutineContext when setting up a Compose scene. This seems like a dangerous default. I did not initially supply this value and it caused deadlocks in my application.
I agree that it's a bad default value, but changing it could break someone's code (after recompilation).
On the other hand, it is really a bad value because:
- It causes effects to be run immediately when they are launched, which changes the order relative to what happens normally.
- When resuming, it resumes on an unspecified thread.
So maybe it's worth changing even it breaks someone's code.
P.S. We should also change this in tests, as I mentioned here: https://youtrack.jetbrains.com/issue/COMPOSE-1290/LaunchedEffect-run-in-composition-phase-in-tests
@igordmn What do you think?
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.