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

getDeviceInterests doesn't support pagination as per API docs #115

Closed
Harsh-br0 opened this issue Oct 26, 2022 · 2 comments · Fixed by #116
Closed

getDeviceInterests doesn't support pagination as per API docs #115

Harsh-br0 opened this issue Oct 26, 2022 · 2 comments · Fixed by #116

Comments

@Harsh-br0
Copy link
Contributor

This is a follow-up of #80
As per this issue-comment

Bug Report

The getDeviceInterests method does not implement the pagination protocol used by the handler

Reproduction Steps

Call getDeviceInterests on a device that has > 100 subscriptions

Expected Result

All device interests should be returned

Actual Result

Only the first 100 interests (the first page) will be returned

@britneycodes
Copy link

Hey @Harsh-br0 , thanks for your submission! Could I have your email address so we can send you some swag?

@Harsh-br0
Copy link
Contributor Author

Harsh-br0 commented Nov 2, 2022

Could I have your email address so we can send you some swag?

Sure @britneycodes , Here it is [email protected]

Edit:

I haven't received any email yet...

sonologico added a commit that referenced this issue Dec 3, 2022
As per docs, getDeviceInterests must accept limit and cursor args to be passed with query parameters in the API. Currently, API returns 100 results since limit implies with 100 as default value in API, so i first redesigned the endpoint caller function here to accept query params as object in params arg and reworked the getDeviceInterests method here to return value as Object that includes cursor field from API response and add limit and cursor to method parameters.
Also I've added a test for params arg in do-request.test.js

Notable Changes
getDeviceInterests now returns Object instead of an Array.
Internal doRequest function can have params arg in Object to represent query params in URL

Co-authored-by: Raphael Sousa Santos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants