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

[ACT-242] Upgrade node-fetch through segment fork of cross-fetch #841

Closed
wants to merge 2 commits into from

Conversation

valerieernst
Copy link
Contributor

A summary of your pull request, including the what change you're making and why.

Currently, requests that have response bodies larger than 16kb hang because of an issue with node-fetch. They fixed the issue in their v3 release. We use node-fetch via cross-fetch. Cross-fetch has no upgraded to node-fetch v3.x, and has no plans to do so.

In order to use node-fetch v3.x+, we needed to fork cross-fetch and upgrade node-fetch in our forked package. This PR implements the forked package.

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [Segmenters] Tested in the staging environment

import { isObject } from './real-type-of'
import type https from 'https'

const REQUEST_HIGH_WATER_MARK = process.env.REQUEST_HIGH_WATER_MARK
? parseInt(process.env.REQUEST_HIGH_WATER_MARK)
: undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldnt the default value be something of the same type? maybe 0. Is this a common pattern in ts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

node-fetch has a default built in, so we end up using that if we pass undefined.

I'll leave a comment so that's more clear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants