-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Pagination params fix #702
Conversation
src/paginator.ts
Outdated
@@ -37,6 +37,7 @@ export class Paginator<Params, Result> | |||
typeof response.headers?.link === 'string' | |||
? this.pluckNext(response.headers.link) | |||
: undefined; | |||
this.nextParams = {}; |
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.
Typecheck seems to be failing. You can just add downcasting such as {} as Params
for now
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.
Fixed.
This stops the duplication of query parameters in our request URL, as Mastodon already gives us the correct parameters in the `Link` header. In some cases, a mixture of parameters from `params` and the `Link` URL could cause the iterator to get caught in an infinite loop. Fixes neet#698.
…rameters Now that query parameter duplication has been fixed, users should be able to safely use `maxId` and `sinceId` in their code. Fixes neet#698.
f866f53
to
257359e
Compare
## [4.6.9](v4.6.8...v4.6.9) (2022-11-26) ### Bug Fixes * Actually send user-specified headers in `HttpAxiosImpl` ([b602fe4](b602fe4)), closes [#697](#697) * Encode URI components in serializer ([8a2be08](8a2be08)) * **fetch:** Normalize header to be lowercase ([f7fce11](f7fce11)) * Fix failing test in [#702](#702) ([a2a4c26](a2a4c26)) * read next link from response ([68c71bd](68c71bd)) * Set `Paginator.nextParams` to an empty object after first request ([4ce57a6](4ce57a6)), closes [#698](#698) * Unmark `DefaultPaginationParams.{maxId, sinceId}` as internal parameters ([257359e](257359e)), closes [#698](#698) * Update Notification.type types ([#706](#706)) ([50c5c5c](50c5c5c))
🎉 This PR is included in version 4.6.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #698.