New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy buffers Transfer-Encoding: chunked responses and breaks streams #1185
Comments
I'm sure this is a bug and it'll be fixed by #687 |
Any ideas on how to workaround this currently? I have a big init call on most page loads that's chunked. Edit: Eventually opted to just change the app itself to disable chunked encoding during tests. |
There are quite some issues that have one common thing among them: |
@jennifer-shehane I wouldn't call it a feature though. |
I updated description as I got some insights. |
I'm not sure if this is exactly the same problem but I also encountered some issues with a chunked HTTP request which should stay open forever. It's used for getting logs from a Kubernetes cluster - not our decision to use such a weird solution... Everything works well in all browsers outside Cypress but the request clearly doesn't get/trigger any updates in Cypress (tested Chrome, Chrome headless and Electron), even after a very long time (30s). Any idea how to debug it further or... solve the problem? This is the code responsible for handling the request in case You need more technical details. |
Any ideas how could we fix this bug? |
@jennifer-shehane could you have a look, please? |
Any updates on this issue? |
I have same problem as mentioned before. Any updates? Our HTTP request is chunked, response type text/event stream. We use Angular frontend where I tried native EventStream, fetch and nx sse client implementation. With EventStream I correctly see data in chrome dev tools. But nothing works correctly in Cypress. Without adding to cypress everything works fine - I see immediately every chunk (Server Sent Event) on frontend. But when I add the URL to the Cypress Proxy, e.g. by adding to intercept command, responses are buffered and are waiting untill the connection ended, e.g. when connection timeouts on backend. Then all data come in one big chunk. At the begining we had same problem on nginx proxy where we needed to disable buffering for this kind of requests. |
+1. This is causing me massive headache. Is there any workaround? I can also see that there might be some connection to
Cypress Chrome (and firefox) don't work and have Accept-Encoding, Content-Encoding gzip and Transfer-Encoding chunked in the response. It seems like cypress requests it or internally forwards the data:
Any way to change this behaviour on the cypress side? |
@wortkrieg or anyone else on this thread, are you able to provide a reproducible example using Cypress Test Tiny that would help our engineers investigate this issue? |
I am going to close this issue as it is quite old at this point. If folks are seeing this behavior in current versions of Cypress please open a new ticket with a reproducible example and we will be happy to investigate. |
Hi friends!
We have a
XmlHttpRequest
that never finishes. We're using it as a stream parsingresponseText
on everyonProgress
event.The problem is that we never get the last chunk as it would be sitting somewhere buffered. We can't really control the server behaviour here and I wonder if the buffer can be flushed after each chunk?
Is this a Feature or Bug?
bug
Current behavior:
cypress waits a request to complete
Desired behavior:
Cypress should propagate
onProgress
events and updateresponseText
accordinglyHow to reproduce:
Transfer-Encoding: chunked
that sends messages one after another and doesn't close throughout the session.onProgress
The text was updated successfully, but these errors were encountered: