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

feat(rest): use Agent with higher connect timeout #8679

Merged
merged 4 commits into from
Sep 25, 2022

Conversation

KhafraDev
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:

Fixes #8629
Fixes #8489

Repeated issue:

I have no way of testing this but 30 seconds seems to work for others.

The issue seems to be with misconfigured ipv6, see nodejs/undici#1531 (comment)

Status and versioning classification:

  • I know how to update typings and have done so, or typings don't need updating
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed) (Not really sure. Increases the time allowed to establish a connection.)

@vercel
Copy link

vercel bot commented Sep 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Sep 25, 2022 at 0:40AM (UTC)

@codecov
Copy link

codecov bot commented Sep 25, 2022

Codecov Report

Merging #8679 (db2e56b) into main (c446a84) will increase coverage by 0.13%.
The diff coverage is 100.00%.

❗ Current head db2e56b differs from pull request most recent head 9ab51b0. Consider uploading reports for the commit 9ab51b0 to get more accurate results

@@            Coverage Diff             @@
##             main    #8679      +/-   ##
==========================================
+ Coverage   86.66%   86.79%   +0.13%     
==========================================
  Files          86       85       -1     
  Lines        8771     8777       +6     
  Branches     1105     1109       +4     
==========================================
+ Hits         7601     7618      +17     
+ Misses       1128     1117      -11     
  Partials       42       42              
Flag Coverage Δ
builders 100.00% <100.00%> (ø)
collection 100.00% <ø> (ø)
proxy 80.46% <ø> (+6.36%) ⬆️
rest 92.01% <100.00%> (+0.01%) ⬆️
utilities 100.00% <ø> (?)
voice 63.83% <ø> (-0.04%) ⬇️
ws 60.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ixins/ApplicationCommandOptionChannelTypesMixin.ts 100.00% <100.00%> (ø)
packages/rest/src/lib/utils/constants.ts 100.00% <100.00%> (ø)
packages/proxy/src/util/util.ts
packages/voice/src/util/util.ts
packages/actions/src/formatTag/formatTag.ts 100.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kodiakhq kodiakhq bot merged commit 64cd53c into discordjs:main Sep 25, 2022
@virtual-designer
Copy link

Finally... have been waiting for a long time for this fix. Thanks @KhafraDev 👍🏻

@KhafraDev KhafraDev deleted the fix-connect-timeout branch September 25, 2022 14:33
@kyranet kyranet added this to the rest v1.2 milestone Sep 25, 2022
@almostSouji
Copy link
Member

almostSouji commented Sep 25, 2022

This was merged under a minor release, but breaks the set/getGlobalDispatcher paradigm and probably needs to be reverted

@KhafraDev
Copy link
Contributor Author

I was surprised it got merged so quickly, I even put that it was likely a breaking change. The real fix is probably waiting for nodejs/node#44731 however.

@almostSouji
Copy link
Member

almostSouji commented Sep 25, 2022

After revisiting internally, we will likely not revert and monitor the repository for bugs caused by this. The chance of it being faulty is very unlikely. Overall the aforementioned pattern is questionable as a recommendation with the slightest consideration of our general user base, as it will globally alter undici for any requests, not just discord.js specific ones.

Fixing the issue currently at hand also has priority at this moment in time - again, actively watching for bugs/breaking reports for the time being.

Tekks added a commit to Tekks/weebly that referenced this pull request Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Undici HeadersTimeoutError: Headers Timeout Error Random connection errors
6 participants