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

Desktop: Fixes #10740: Improve the reliability of fetching resources #10826

Conversation

pedr
Copy link
Collaborator

@pedr pedr commented Aug 5, 2024

Fixes: #10740

Summary

As reported by the user, the new code, when timeout is set to undefined, uses the http.globalAgent which has a default timeout to 5 seconds.

Previously, this wouldn't be a problem because we didn't have an event handler for timeout event, so now I'm checking if the timeout was specified for this request, and if it wasn't I opt to not destroy the request.

I also added more information to the log message when the request timeout.

Testing

To test this change I created a simple HTTP server, with a sleep function in the endpoint that returns one of the images from a static HTML page.

After that, I used the Web Clipper to save the full HTML page, which will use the fetchBlob function to download the image.

The sleep function should be higher than the timeout value, if that happens we can see the timeout event being generated.

@pedr pedr added bug It's a bug desktop All desktop platforms labels Aug 5, 2024
@laurent22 laurent22 merged commit a6cf0a3 into laurent22:release-3.0 Aug 5, 2024
10 checks passed
@pedr pedr deleted the remove-timeout-from-fetchBlob-by-default branch August 5, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants