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

fix(http-connect): try wrapping fetch so that it's passed and agent t… #960

Merged
merged 5 commits into from
May 4, 2023

Conversation

MarcMcIntosh
Copy link
Contributor

https://linear.app/prismic/issue/DT-1271/pushing-changes-sometimes-fails-with-error-getaddrinfo-enotfound

Looks like enotfound errors could be coming from node-fetch
node-fetch/node-fetch#449
and
node-fetch/node-fetch#79
seems that lots of requests, looks like people are fixing it by passing a user agent node-fetch/node-fetch#1735

Context

The Solution

Impact / Dependencies

Checklist before requesting a review

  • I hereby declare my code ready for review.
  • If it is a critical feature, I have added tests.
  • The CI is successful.
  • If there could backward compatibility issues, it has been discussed and planned.

[OPT] Preview

Copy link
Collaborator

@bapmrl bapmrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This fix might work, but it would be reassuring if we could find a way to reproduce the issue 🙂

Also, I think the manager's tests should be using the same packages/manager/src/lib/fetch.ts module for consistency.

Note that I found more explanations here: node-fetch/node-fetch#1735.

packages/manager/src/lib/fetch.ts Outdated Show resolved Hide resolved
Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline with @bapmrl's comment, it would be good to have a reproduction of the issue or a test that confirms this fix is effective. However, I understand that would be tricky to implement.

The implementation could be simplified, in my opinion, as well as benefit from some context around why the wrapper exists.

I opened a PR with some changes (it was quicker to write the changes than to explain them): #961

Feel free to use it or not. 🙂

bapmrl and others added 2 commits May 4, 2023 10:15
@MarcMcIntosh MarcMcIntosh merged commit af55291 into master May 4, 2023
@MarcMcIntosh MarcMcIntosh deleted the mm/http-keep-alive branch May 4, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants