-
Notifications
You must be signed in to change notification settings - Fork 192
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
fix: paging parsing issues #728
Conversation
Typescript Tests 3 files - 4 72 suites - 4 41s ⏱️ - 3m 0s Results for commit 4379307. ± Comparison against base commit 1a835a8. This pull request removes 25 and adds 1 tests. Note that renamed tests count towards both.
|
@@ -34,7 +34,7 @@ import { IAPIMethods } from './apiMethods' | |||
import { BaseTransport } from './baseTransport' | |||
|
|||
export const LinkHeader = 'link' | |||
export const TotalCountHeader = 'X-Total-Count' |
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.
I feel like I see the capitalized form of http headers more often: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
also, server/client should consider them case-insensitive: https://stackoverflow.com/a/5259004/13802304
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.
Yeah, it's a problem with the headers handling in JS. I responded via chat that I think we need to support both the Title case and lowercase at least.
packages/sdk-rtl/src/paging.ts
Outdated
@@ -363,7 +363,7 @@ export class Paging<TSuccess extends ILength, TError> | |||
} | |||
|
|||
parse(raw: IRawResponse): IPager<TSuccess, TError> { | |||
const req = new URL(raw.url) | |||
const req = new URL(raw.url, 'https://localhost') |
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.
hm, do we have access to the settings base_url
here?
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.
Exactly my thought, as well. Sorry, I should have responded to the PR rather than via chat.
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.
LGTM
raw.headers[name] || | ||
raw.headers[name.toLowerCase()] || | ||
raw.headers[name.toUpperCase()] |
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.
Recognizes all three reasonable casing options for the header
parse(raw: IRawResponse): IPager<TSuccess, TError> { | ||
const req = new URL(raw.url) | ||
const params = req.searchParams | ||
const params = new URLSearchParams(raw.url) |
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.
Handles full or relative urls
Typescript Tests 7 files 76 suites 3m 50s ⏱️ Results for commit 4286ec7. |
This comment has been minimized.
This comment has been minimized.
🤖 I have created a release \*beep\* \*boop\* --- <details><summary>sdk-codegen-all: 1.9.1</summary> ### Bug Fixes * paging parsing issues ([#728](https://www.github.com/looker-open-source/sdk-codegen/issues/728)) ([f8eec43](https://www.github.com/looker-open-source/sdk-codegen/commit/f8eec43bdfbe337d41b1da02c127d690c8815ed3)) </details> <details><summary>@looker/sdk-codegen-scripts: 21.0.20</summary> ### Bug Fixes * noStreams skips tally headers in generated source ([#727](https://www.github.com/looker-open-source/sdk-codegen/issues/727)) ([113c2c5](https://www.github.com/looker-open-source/sdk-codegen/commit/113c2c50c07c621cf94841af75557704fc3f5df7)) ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-codegen bumped from ^21.0.18 to ^21.0.19 * @looker/sdk-node bumped from ^21.8.0 to ^21.8.1 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 </details> <details><summary>@looker/sdk-rtl: 21.0.15</summary> ### Bug Fixes * paging parsing issues ([#728](https://www.github.com/looker-open-source/sdk-codegen/issues/728)) ([f8eec43](https://www.github.com/looker-open-source/sdk-codegen/commit/f8eec43bdfbe337d41b1da02c127d690c8815ed3)) </details> <details><summary>@looker/sdk: 21.8.2</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 </details> <details><summary>@looker/sdk-codegen: 21.0.19</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 </details> <details><summary>@looker/extension-sdk: 21.8.2</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 </details> <details><summary>@looker/sdk-node: 21.8.1</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 </details> <details><summary>@looker/code-editor: 0.1.4</summary> ### Dependencies * The following workspace dependencies were updated * devDependencies * @looker/sdk-codegen bumped from ^21.0.18 to ^21.0.19 </details> <details><summary>@looker/extension-sdk-react: 21.8.2</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/extension-sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 </details> <details><summary>@looker/wholly-sheet: 0.5.10</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 * devDependencies * @looker/sdk-node bumped from ^21.8.0 to ^21.8.1 </details> <details><summary>@looker/run-it: 0.9.11</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-codegen bumped from ^21.0.18 to ^21.0.19 * @looker/code-editor bumped from ^0.1.3 to ^0.1.4 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 </details> <details><summary>@looker/hackathon: 21.8.1</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/extension-sdk bumped from ^21.8.1 to ^21.8.2 * @looker/extension-sdk-react bumped from ^21.8.1 to ^21.8.2 * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 * @looker/wholly-sheet bumped from ^0.5.9 to ^0.5.10 </details> <details><summary>@looker/api-explorer: 0.9.11</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/code-editor bumped from ^0.1.3 to ^0.1.4 * @looker/run-it bumped from ^0.9.10 to ^0.9.11 * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-codegen bumped from ^21.0.18 to ^21.0.19 * @looker/sdk-rtl bumped from ^21.0.14 to ^21.0.15 * devDependencies * @looker/sdk-codegen-scripts bumped from ^21.0.19 to ^21.0.20 * @looker/sdk-node bumped from ^21.8.0 to ^21.8.1 </details> <details><summary>@looker/extension-api-explorer: 21.8.1</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * @looker/api-explorer bumped from ^0.9.10 to ^0.9.11 * @looker/extension-sdk bumped from ^21.8.1 to ^21.8.2 * @looker/extension-sdk-react bumped from ^21.8.1 to ^21.8.2 * @looker/run-it bumped from ^0.9.10 to ^0.9.11 * @looker/sdk bumped from ^21.8.1 to ^21.8.2 * @looker/sdk-codegen bumped from ^21.0.18 to ^21.0.19 </details> This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This PR fixes 2 issues:
BaselessSettings
andcredentials: same-origin
directly from the TS sdk.x-total-count