One request, two responses
See original GitHub issueHI guys,
I’m facing an issue since yesterday that I can’t solve by myself so I’m asking your help since I don’t know if it’s a bug or not.
I use apisauce v0.14.0 + react 16.0.0-alpha.6 + react-native 0.44.3 + redux-saga 0.15.3
I added some logs in addRequestTransform
and addResponseTransform
From a saga, I call an endpoint from my API. I can see the right data passing by addRequestTransform
and a correct response passing by addResponseTransform
. The exact response I’m waiting for.
BUT I’ve a second response passing by addResponseTransform
with a weird data:
{
duration: 89,
problem: 'UNKNOWN_ERROR',
ok: false,
status: null,
headers: null,
config: null,
data: null
}
and so, that’s the response received and processed by the saga which brings an unprocessable response.
When I google for UNKNOWN_ERROR
the only occurence I find is in apisauce
source code.
Does anyone has any idea of what could bring me to this error code?
Thanks for your help
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top GitHub Comments
The AsyncStorage code is in the following saga when I fetch the device token with
yield call(PushNotification.getDeviceToken)
Do you have more than one request transform?
=> yes, I’ve that one, scaffolded by igniteand one that I created:
Is there more than one listener to the REGISTER_DEVICE_REQUEST action?
=> nopeThe current state of my inspection is:
REDUX_PERSIST
which is enabled. If I disable it, I only have the event onceaddResponseTransform
, the response is on success and I’ve noUNKNOWN_ERROR
triggered:this condition is used to avoid transform if I’m fetching our API v0 I will add a specific header to do a better check
Oki, I will search into that direction. Thanks a lot!