You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
p.Next(ctx) receives an error from t.c.userRequest() on line 328 and returns an error (that isn't the errPaginationComplete) without setting the t.previousResp. Since we're not done (!p.Done(err)), we continue paginating and hit p.Next(ctx) again. This time, line 314 evaluates to true (since we have a non-nil t.previousResp but an empty t.previousResp.Cursor b/c it was never set on line 334 when we returned early from the previous iteration. We then fire off an errPaginationComplete error, effectively ending pagination but not letting the user know that their data is incomplete.
A quick fix might be as simple as changing the for loop in GetUsersContext to:
Actual Behavior:
The
(api *Client) GetUsersContext()
method stops paginating if it encounters any errors during pagination, and returns a nil error.Expected Behavior:
The method would return the actual error encountered so that we know that the returned data is incomplete.
Happy to provide more info if necessary, but it seems to be a simple issue w/ the for loop in
GetUsersContext
:p.Next(ctx)
receives an error fromt.c.userRequest()
on line 328 and returns an error (that isn't theerrPaginationComplete
) without setting thet.previousResp
. Since we're not done (!p.Done(err)
), we continue paginating and hitp.Next(ctx)
again. This time, line 314 evaluates to true (since we have a non-nilt.previousResp
but an emptyt.previousResp.Cursor
b/c it was never set on line 334 when we returned early from the previous iteration. We then fire off anerrPaginationComplete
error, effectively ending pagination but not letting the user know that their data is incomplete.A quick fix might be as simple as changing the for loop in
GetUsersContext
to:The text was updated successfully, but these errors were encountered: