Skip to content

Commit

Permalink
HTTP cache: do not remove cached entries on transport errors
Browse files Browse the repository at this point in the history
See #6313
  • Loading branch information
martinbonnin committed Dec 10, 2024
1 parent 0f0961f commit e97f638
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal class HttpCacheApolloInterceptor(
onEach { response ->
// Revert caching of responses with errors
val cacheKey = synchronized(apolloRequestToCacheKey) { apolloRequestToCacheKey[request.requestUuid.toString()] }
if (response.hasErrors() || response.exception != null) {
if (response.hasErrors()) {
try {
cacheKey?.let { cachingHttpInterceptor.cache.remove(it) }
} catch (_: IOException) {
Expand Down

0 comments on commit e97f638

Please sign in to comment.