Just a general question about retrofit + coroutine...
# squarelibraries
c
Just a general question about retrofit + coroutine cancellation. I'm basically building a search form where we debounce as the user types by 250ms then we search.
Copy code
init {
  viewModelScope.launch {
    myState.queryText.debounce(250).collectLatest {
        search(it)
    }
  }
}

private suspend fun search(term: String) {
    val result = service.searchApiCall(term)
...
I'm trying to manually verify that service.searchApiCall is actually cancelled. I'm looking at the requests through charles proxy but it doesn't seem to cancel there. I'm assuming that a cancellation on retrofit can't actually cancel the in flight request right? My networking inexperience is kinda failing me here, but would appreciate any pointers to make sure that Im cancelling correctly.