Never ending request
See original GitHub issueDescription
I use PollyJS with Puppeteer to record and replay http requests in E2E test context. I have one never-ending http call, I’m trying to figure out why. I didn’t managed to find the root cause of it and started to wonder if it could be a bug.
- Every other requests works as expected, only this one doesn’t.
- the request is an http POST to a laravel backend to get an auth token:
/oauth/token
- Based on body parameters, if username and password are invalid, the backend answer with an error and PollyJS behave correctly
- If username and password are valid, the backend answer code 200 with a token
- Request works as expected when Polly is not enabled and request interception is off
Manual tests in devtools
fetch(url, {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json;charset=UTF-8',
},
body: JSON.stringify(credentials),
}
Without polly
With polly



I tried to understand what is happening by watching page events in the polly-puppeteer-adapter and have seen my request going through these events : request / response / request failed (timeout)
Dependencies
{
"@pollyjs/adapter-puppeteer": "^2.6.0",
"@pollyjs/core": "^2.6.0",
"@pollyjs/persister-fs": "^2.6.0",
}
Config
new PollyJS('', {
mode: 'passthrough',
adapters: ['puppeteer'],
persister: 'fs',
});
Environment
Node.js v11.5.0
darwin 18.7
6.10.2
1.17.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14
Top Results From Across the Web
node.JS how to stop a never ending request? - Stack Overflow
I just ran your code and commented out res.end() and it works for me on my computer function selectCb(err, results, ...
Read more >What is the technique called in which you return a never ...
In long polling, there is a long timeout on a request. The request/response isn't "never ending" at all.
Read more >Http Request never ends - Oracle Communities
Hi, Well I had a few minutes on my hand and decided to build a simple socket application that handles a browser request...
Read more >How to finish the never-ending project - ProProject Manager
Treat the request like any other change request. Any time extensions are validated, approved, and incorporated into the schedule. Projects end.
Read more >Its a never ending request - TikTok
TikTok video from V (@theytrynatakemyshi): "Its a never ending request". When we just had play time but she wanna play again. original sound....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@offirgolan ok, I’m preparing that 👍
More findings:
The passthrough request that Polly makes (the one immediately under the timed out request) occurs via
fetch
and the API responds back with an empty body and a 200 status code. This is likely why the original, non-passthrough, request times out. The intended request happens overxhr
and does respond with a body. If you make the call over curl, the API responds also as expected as wellXHR and
curl
both return a response body:Identical request over the native
fetch
however does not respond with a body:I’ll need to compare the two and figure out why that is. I think perhaps the solution here is if the request happens over XHR - make the request over XHR and if it happens over fetch then make the request over fetch. The only thing I can think of is there is a registered XHR request event (i.e.,
load
,loadend
,abort
, etc.) that’s not firing because we go over fetch. The body format of these responses are also not really human readable and the format name is called JSPB.