Hey everyone
Sorry, if this is not the right channel to ask this.
I'm facing a weird issue with PagingData's
cachedIn()
flow operator
• If I have a
cachedIn()
operator before
catch {}
operator, catch operator does not work and the flow throws an exception and my app crashes
• If i have
catch{}
before
cachedIn()
, the flow never completes, and nothing is displayed in my UI
It all works fine, if I dont have
cachedIn()
at all
This is a small test I've written to verify it
test("Should not crash"){
val flow = flow<PagingData<Int>> { throw IllegalStateException("Testing") }
shouldNotThrowAny {
flow.cachedIn(this).catch { }.collect()
}
}
It passes if I remove
cachedIn()
, but fails with it
and test never completes if I put
cachedIn()
after catch