Skip to content
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

Question about situation when there are multiple XHR requests #1

Closed
ChaunceyKiwi opened this issue Dec 31, 2018 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@ChaunceyKiwi
Copy link

page.on('request', request => {
if (request.resourceType() === this.resourceType) {
this.pendingXhrs.add(request);
if (!this.promise) {
this.promise = new Promise(resolve => {
this.resolver = resolve;
});
}
}
});

From my understanding of code, it seems that if there are two pending XHRs, only the first one will trigger a creation of promise and link its resolve() to resolver. The second one will not have its own promise object and resolver. How can you make sure each request is handled properly in this way. Correct me if I am wrong :)

@jtassin jtassin added the bug Something isn't working label Jan 2, 2019
@jtassin
Copy link
Owner

jtassin commented Jan 2, 2019

Hi @ChaunceyKiwi thx a lot for your feedback.
You are right, there is a problem here. I'll fix it.

jtassin pushed a commit that referenced this issue Jan 4, 2019
@jtassin jtassin closed this as completed in dfbe71e Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants