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

Closed
Haroenv opened this issue May 21, 2021 · 1 comment · May be fixed by #1272
Closed

Extremely large timeouts trigger immediately #1271

Haroenv opened this issue May 21, 2021 · 1 comment · 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
@shortcuts
Copy link
Member

closing until someone raise an issue but I believe that would require a fix on most clients

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.

2 participants