Open arturdanielyan1 opened 1 month ago
It turns out I didn't know that MutableSharedFlow with onBufferOverflow strategy DROP_OLDEST must have a positive extraBufferCapacity, but if that's the reason of the InstanceCreationException I think this is still a bug in Koin library as the error message doesn't tell anything related to the actual error. I unserstand that this happens at the ViewModel intialization time but as I said the error message tells completely different thing.
In the ViewModel I have this:
Requesting this ViewModel like this in a composable function:
throws an exception: Process: com.nightx.ingale, PID: 14374 org.koin.core.error.InstanceCreationException: Could not create instance for '[Factory:'MyViewModel']'
The second I remove the line:
onBufferOverflow = BufferOverflow.DROP_OLDEST
everything works perfectly fine.
Also works when I create the MutableSharedFlow lazily:
Behaviour is the same in versions 3.5.3 and 3.5.6