Issue 1:
I have searched for a while if anyone has experienced this but I haven't found anything on this exact regard.

I have a vue/cordova application where I perform an axios.all post call where sometimes I get duplicated responses. The times this happend I watch the server logs and I can see that the server is sending distinct values but on google's network tab I see that I don't get the same responses the server is returning. In my tests if the server returns 3 different responses sometimes I get two (or even three) duplicate responses. I have tested in chrome and in firefox.

This is a stripped down version of my client code (I only removed unnecessary things):

let solicitudesRequests = []
axios.post(this.endpoint_canal, JSON.stringify(my_object))
.then((response) => {
let autorizaciones = response.data
if (autorizaciones !== undefined) {
if (!(autorizaciones instanceof Array)) {
autorizaciones = [autorizaciones]
}
autorizaciones.forEach((autorizacion) => {
let another_object = {
val1: autorizacion.val1
val2: autorizacion.val2
}
solicitudesRequests.push(another_object)
})
return axios.all(solicitudesRequests)
}
})
.then((responses) => {
responses.forEach((response) => {
console.log('response obtained: ', JSON.stringify(response.data)) // here I get duplicated data
let registro = response.data
if (registro !== undefined) {
if (!(registro instanceof Array)) {
registro = [registro]
}
this.solicitudes.push(...registro)
}
})
})
.catch((exception) => {
console.error(exception)
})

As I said the server is returning different responses but I get duplicated data, what could be the problem here?

Thank you!

Issue 2:
Describe the bug

axios.post sends duplicate POST request and ignores the first response, only receives the second response.

To Reproduce

I don't know how to reproduce it since it's occurred.

export const axiosAfterLoginRequest = (properties = {}, defaultConfig = {}) => (
config = {}
) => {
const {
accessTokenKey = "",
accessTokenValue,
cookieName = STORAGE.USER_TOKEN
} = properties
const configMerge = merge(cloneDeep(defaultConfig), config)
const headers = get(configMerge, "headers", {})
const token = getLocalItem(cookieName)
const accessToken = !isNil(accessTokenValue)
? accessTokenValue
: get(token, accessTokenKey)
if (!isNil(accessToken) && !isEmpty(accessToken)) {
headers.Authorization = `Bearer ${accessToken}`
}
return { ...configMerge, headers, ...timestampConfig() }
}
const apiInstance = axios.create({
baseURL: API_URL
})

const request = axiosAfterLoginRequest(
{ accessTokenKey: "access_token" },
{
headers: {
post: {
"Content-Type": "application/json"
}
}
}
)

apiInstance.interceptors.request.use(request)

export const submitApi = (payload) =>
apiInstance.post("url"), payload)

export function* submitSaga(action) {
try {
const response = yield call(submitApi, action.payload)
yield put({type: "success"})
} catch (e) {
yield put({type: "error"})
}
}

The submit function above is only called once, while the axios.post() is called twice. I have log for my system, in subject Additional context/Screenshots

Expected behavior

The request is only sent once.

Environment:

Axios Version [e.g. 0.19.0]

OS: [e.g. Android 10; SM-G970U]

Browser [e.g. Chrome]

Browser Version [e.g. 80]

Additional Library Versions [e.g. React 16.8, redux 4.0.1 react-redux 7.1.0 redux-saga 1.0.3 ]

Additional context/Screenshots

You will see request.query.t for first and second time. it same requested.