Closed bupy7 closed 1 month ago
Workaround:
import axios from "axios";
import { buildMemoryStorage, setupCache } from "axios-cache-interceptor/dev";
const cachedAxios = setupCache(axios.create(), {
storage: buildMemoryStorage(false),
});
cachedAxios.interceptors.response.use((v) => {
return {
...v,
data: v.data !== undefined ? JSON.parse(JSON.stringify(v.data)) : undefined,
}
})
HI @bupy7, thanks for opening this request.
Would you want to open a PR? remember to add unit tests.
Taking a look at our existing unit tests is a good way to start and learn how its done.
Fixed in v1.6.1
What happened?
Cloning do not work correctly with concurrency request: https://codesandbox.io/p/sandbox/j9cfcl
In this example I have changed "name" property in the request with "0" index key. Every next requests persist this change.
This is not happen if request do sequentially. To reproduce behavior - try
runSequentially()
andrunSpreadly()
functions in the code example.axios-cache-interceptor version
v1.6.0
Node / Browser Version
any browser
Axios Version
v1.7.7
What storage is being used
Memory Storage
Relevant debugging log output