Marcel
02/14/2025, 12:25 PMrefresh method to trigger a refresh the flow never emits from the top of the flow:
• The next code does not behave the same between Android and iOS
• When calling refresh() from both apps:
◦ Android:
▪︎ Prints the "Emit refresh" and the "1 refreshing flow!" and "2 remitting flow!", showcasing that the flow chain is retriggered as expected.
◦ iOS:
▪︎ Only prints the first "Emit refresh" and nothing else happens after.
private val refreshTrigger: MutableSharedFlow<Unit> = MutableSharedFlow<Unit>(extraBufferCapacity = 1)
override operator fun invoke() = refreshTrigger
.onStart { emit(Unit) }
.onEach { Logger.i("1 refreshing flow!") }
.flatMapLatest {
ReveriLogger.i("2 remitting flow!")
randomFlow()
}
.asResult()
override fun refresh() {
ReveriLogger.i("Emit refresh")
refreshTrigger.tryEmit(Unit)
}
If the randomFlow() reemits, everything works on iOS. So we are correctly listening to the flow. It seems the issue is only with the refresh not working 🤔Marcel
02/14/2025, 12:26 PMVidmantas Kerbelis
02/14/2025, 2:21 PMasResult() function is doing and what it is returning, that might have some issue.
Also not sure what exactly randomFlow does, it might be the issue.Vidmantas Kerbelis
02/14/2025, 2:26 PMMarcel
02/14/2025, 3:01 PM