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

Auto Paging is not working #23

Open
snappet-panksy opened this issue Aug 30, 2019 · 4 comments
Open

Auto Paging is not working #23

snappet-panksy opened this issue Aug 30, 2019 · 4 comments

Comments

@snappet-panksy
Copy link
Contributor

I believe the paging is not working with any client but I specifically tested it on the Activity Client with an integration test. - The default page size is 100 there are more than 100 activities in the sandbox. This test fails. I can see that the API Pagination is expecting items in the header which are no longer there.

            [IntegrationTest]
            public async Task ReturnsMultiplePages()
            {
                var pipedrive = Helper.GetAuthenticatedClient();
                var startFilters = new ActivityFilters();
                var allPages = await pipedrive.Activity.GetAll(startFilters);
                Assert.True(allPages.Count > 100);
            }

I put in a nasty hack in a branch I am using but I think there must be a better way to resolve this using your existing pattern.

ReadOnlyPagesCollection never has a next page:

        public async Task<IReadOnlyPagedCollection<T>> GetNextPage()
        {
            var nextPageUrl = _info.GetNextPageUrl();
           if (nextPageUrl == null) return null;

nextPageUrl is always null.

@DavidRouyer DavidRouyer changed the title Paging is not working Auto Paging is not working Aug 30, 2019
@DavidRouyer
Copy link
Owner

Indeed, there is no auto paging on the endpoints. It would be fairly easy to implement by using the informations fetched from the endpoints that are populated in https://github.com/DavidRouyer/pipedrive-dotnet/blob/master/src/Pipedrive.net/Models/Response/PaginationInfo.cs, but I don't I'll implement it due to the number of requests it could create (Pipedrive is kinda slow) and there is the rate limiting to take into account.

You can paginate through the pages manually.

@redflowIT
Copy link

redflowIT commented Feb 18, 2020

I'm trying to use manual pagination with Deals but incrementing StartPage in DealsFilter I'm getting next page in the list.....how should I get the 'stop' condition? When I'll get the last one?

..my error is working on StartPage considering as number of page instead of number of item in the list.....probably it's better to change the name of the property.

@gregarican
Copy link
Contributor

gregarican commented May 26, 2020

It would be beneficial if there was an improved method of auto pagination. Especially since the return type for GetAll() is typically a read-only list. Also, as mentioned above the StartPage property is really the StartRecord.

@GuerrillaCoder
Copy link

I am also wondering how to know if there is a next page as no next page value on read only list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants