I need help :slightly_smiling_face: I have an issu...
# coroutines
p
I need help 🙂 I have an issue with undeclared throwables in retrofit when switching to Dispatchers.Main.Immediate. https://github.com/square/retrofit/issues/3128#issuecomment-550989230 https://jakewharton.com/exceptions-and-proxies-and-coroutines-oh-my/ What's so special with
Dispatchers.Main.immediate
that causes this behavior?
@jw cc
o
I suspect the key is in this line from the article:
This indicates a checked exception was somehow being synchronously thrown.
the immediate dispatcher always runs synchronously if possible, without a suspend boundary, so you can have the exception thrown in the proxy quite easily
p
I hope this can be fixed. Just refactoring everything back to singles now for my release -.-
l
I'd just use
Dispatchers.Main
when dealing with retrofiit to avoid that issue. I'm wondering if you could have the issue when using
Dispatchers.Default
or
<http://Dispatchers.IO|Dispatchers.IO>
too 🤔
p
In my case it's the viewmodel which collects from a flow on the immediate dispatcher as default because else there are artifacts when one source of the viewstate flow is a user input event. To my viewmodel it's not transparent that there is room somewhere in the chain, it originates somewhere in a repository