I've noticed that if molecule composition happens together with ui composition the molecule composition is "missed".
It never happens with the ContextClock mode but it's quite easy to reproduce with the Immediate mode and non-ui dispatcher.
Below there is an example of counter that updates the local state and sends a message to update the state produced by molecule. In 5-15 clicks (no need to click fast though) it's possible to get the wrong state when the states are not equal. The next click after that usually makes them equal again (which I think means that the state in molecule gets updated, but it doesn't trigger a recomposition, probably because the ui recomposition is currently in progress).
I've noticed that if molecule composition happens together with ui composition the molecule composition is "missed". It never happens with the ContextClock mode but it's quite easy to reproduce with the Immediate mode and non-ui dispatcher.
Below there is an example of counter that updates the local state and sends a message to update the state produced by molecule. In 5-15 clicks (no need to click fast though) it's possible to get the wrong state when the states are not equal. The next click after that usually makes them equal again (which I think means that the state in molecule gets updated, but it doesn't trigger a recomposition, probably because the ui recomposition is currently in progress).
Molecule 1.4.2 Compose compiler 1.5.11 Compose runtime 1.7.0-alpha06 (to get #396 fixed) Android SDK 34