arthurfiorette / axios-cache-interceptor

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!
https://axios-cache-interceptor.js.org
MIT License
703 stars 58 forks source link

if a transformresponse function is used, it has some unintended side effect #775

Closed amrendr-cb closed 10 months ago

amrendr-cb commented 10 months ago

If we use a transformResponse function that transform the response entirely in different format than what is received from server, axios again apply the transform function on the the already transformed response and it produce an undesired result.

This is related to discussion https://github.com/arthurfiorette/axios-cache-interceptor/discussions/771

codecov[bot] commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (eb45a1b) 99.58% compared to head (b3b6510) 99.66%.

Files Patch % Lines
src/interceptors/request.ts 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #775 +/- ## ========================================== + Coverage 99.58% 99.66% +0.08% ========================================== Files 19 19 Lines 2390 2395 +5 Branches 213 213 ========================================== + Hits 2380 2387 +7 + Misses 9 7 -2 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

arthurfiorette commented 10 months ago

lgtm

Thanks!