-
Notifications
You must be signed in to change notification settings - Fork 43
getHttpClient produces errors while removing and setting cookies #1039
Comments
Example error occurs during these requests in a Which follows this request in a |
I think I don't get it, I tried to reproduce it on a fresh project, with 3 request to mocked endpoint which sends cookies in Does the error is thrown, if one of those simultaneous requests fails? |
In my case the I put my patch in place locally and kept working on my task; I will try to recreate the issue now that I have the routes and data loading mostly complete.. |
Repository with reproduced error would be awesome, cause I want to eliminate the source of the problem, but cannot do without actual errors. |
The end result of my PR does not cause the error, even though it does similar steps: https://github.com/TrueCar/consumer-frontend/tree/c4a717ef8574f248edcffb1be065e8fd97722a7d So that's good; i was worried this would block deployment. But the commit I referenced previously does still cause it. Unfortunately it's not easy to reproduce without some data for the Trade app; we make have to table this one until we check in some seed data. |
The
client.interceptors.response.use
function ingetHttpClient
can produce errors for both setting and removing cookies if headers have already been sent. Specifically, these errors:In my case, these errors occur when a
gsBeforeRoute
dispatches a GET after receiving a previous GET result. I will link below to my usage that generates the errors. With the current release of gluestick-shared, the errors are caught by redux promise middleware and cause silent failures with empty data. The errors can be caught closer to their source and ignored, which allows the data to be returned normally (PR incoming), but this ignores whatever is the root cause.My use case is generating email content, which is solely server-side rendering and means I can't use the workaround in this comment:
Extra info: my
gsBeforeRoute
is sending three simultaneous requests to the same API endpoint. If I log the cookies that are triggering the errors, I can see that one of them is a session identifier. That suggests to me that the intent of "Ensure that any subsequent requests are passing the cookies" is not fulfilled.Related: #881
The text was updated successfully, but these errors were encountered: