-
Notifications
You must be signed in to change notification settings - Fork 17
fix: Improve retry mechanisms for split pdf logic #108
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
Conversation
279fc39
to
cc0e396
Compare
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.
on line 213 wont this assignment fail:
(this.partitionSuccessfulResponses[operationID] as Response[])[pageIndex][pageIndex] =
response.clone();
because this.partitionSuccessfulResponses[operationID] has not been initialized to an array?
Have a look at line 192, the success responses is initialized, but the fail responses is not:
this.partitionSuccessfulResponses[operationID] = new Array(requests.length);
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.
Good catch! Thanks
04c2406
to
6291cf6
Compare
Ah, one sec, we may need to hardcode our retry values in here - let me look. EDIT - all good now. |
const { baseURL } = opts; | ||
this.client = new HTTPClientExtension(); | ||
|
||
this.client.addHook("response", (res) => { |
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 we could move this into the HTTPClientExtension class? not necessary though
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.
Makes sense to me!
30260d9
to
16d75a1
Compare
HTTPClient hooks. The autogenerated code takes these values from the `x-speakeasy-retries` section of our OpenAPI spec. However, when we call `retry` directly like this, we need to be able to pass the values in. Once we have a reference to the SDK in the hook context, we can make requests via `s.general.partition` and avoid duplicating logic.
30de60c
to
9ca0ab5
Compare
No description provided.