-
Notifications
You must be signed in to change notification settings - Fork 0
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
Optional request timeout #41
Conversation
.husky/pre-commit
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to be executable so it can run as a commit hook
@@ -4,7 +4,7 @@ | |||
|
|||
## EppoJSClient.getAssignment() method | |||
|
|||
<b>Signature:</b> | |||
**Signature:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest auto-generated docs use **
for bolding and _
for italic. (which I prefer in GitHub markdown anyways 📈 )
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [IClientConfig](./js-client-sdk.iclientconfig.md) > [requestTimeoutMs](./js-client-sdk.iclientconfig.requesttimeoutms.md) | ||
|
||
## IClientConfig.requestTimeoutMs property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autogenerated docs for newly added client configuration
@@ -49,7 +49,7 @@ | |||
"prettier": "^2.7.1", | |||
"terser-webpack-plugin": "^5.3.3", | |||
"testdouble": "^3.16.6", | |||
"ts-jest": "^28.0.5", | |||
"ts-jest": "^29.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm
was not happy installing an older version of ts-jest
with a newer version of jest
. Bumping appeased it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a yarn install
using node 16.20, as that is the min version in our common client (source)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I missed it in the PR description: why was this needed for the sample size calculator? Were the counts looking wrong due to SDK timeouts?
try { | ||
const axiosInstance = axios.create({ | ||
baseURL: config.baseUrl || constants.BASE_URL, | ||
timeout: config.requestTimeoutMs || constants.REQUEST_TIMEOUT_MILLIS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
🎟️ Ticket: FF-1256 - Optionally pass and use, if present, the Sample Size Calculator Run ID in traffic count data tasks
Currently, our client has a hard-coded default timeout of five seconds (5000 milliseconds) to request the configuration from the CDN. If it fails, it will throw a timeout error.
However, some clients may want to specify the timeout. This pull request adds a new optional client configuration option,
requestTimeoutMs
, to allow upstream callers ofinit()
to specify a desired timeout. If it's not specified, we continue to use our default.This pull request also adds a helpful warning message explaining the impact of a failed initialization.
Lastly, some cleanup around package version compatibility and auto-generated docs have been done as well.
For example, the below results in an error when simulating six-second latency, but the error message shows the overridden three-second timeout is at play:
And a timeout of ten seconds is sufficient for success even with six-second latency.