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

Extremely large timeouts trigger immediately #1271

Open
Haroenv opened this issue May 21, 2021 · 0 comments · May be fixed by #1272
Open

Extremely large timeouts trigger immediately #1271

Haroenv opened this issue May 21, 2021 · 0 comments · May be fixed by #1272

Comments

@Haroenv
Copy link
Contributor

Haroenv commented May 21, 2021

see: https://stackoverflow.com/questions/3468607/why-does-settimeout-break-for-large-millisecond-delay-values

approximate reproduction:

  const client = getAlgoliaClient(applicationData, {
    queryParameters: userId ? { 'X-Algolia-UserID': userId } : undefined,
    timeouts: {
      connect: 2,
      read: 3600000,
      write: 3600000,
    },
  });

solution:

  1. calculate max timeout (using
    getTimeout(timeoutsCount: number, baseTimeout: number): number {
    with the largest number * 1000)
  2. when transporter gets created, error when timeout is larger than 2147483647/0x7FFFFFFF/2^31-1
@Haroenv Haroenv linked a pull request May 21, 2021 that will close this issue
4 tasks
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 a pull request may close this issue.

1 participant