up-bank-api icon indicating copy to clipboard operation
up-bank-api copied to clipboard

not getting a next link for transactions

Open bentwonk opened this issue 3 years ago • 9 comments

await up.transactions.listByAccount("accountID,{pageSize: 10, filterSince:"2020-03-01T12:02:03Z",filterUntil:"2021-11-30T18:02:03Z"});

returns pagesize (10) results, but no next page link.

"links": { "prev": null }

could this be related to recent changed to pagination?

bentwonk avatar Dec 19 '21 05:12 bentwonk

That's an interesting one @bentwonk. It could very well be related to the recent change in pagination. Are you getting previous and next links for any other API calls or is it broken for all of them?

Maybe @IAmMadfly would be able to shed some more light?

ndench avatar Dec 22 '21 04:12 ndench

up.transactions.list()

On Wed, Dec 22, 2021 at 3:24 PM Nathan Dench @.***> wrote:

That's an interesting one @bentwonk https://github.com/bentwonk. It could very well be related to the recent change in pagination. Are you getting previous and next links for any other API calls or is it broken for all of them?

Maybe @IAmMadfly https://github.com/IAmMadfly would be able to shed some more light?

— Reply to this email directly, view it on GitHub https://github.com/ndench/up-bank-api/issues/19#issuecomment-999276307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMQ23IMK25HBB36ZBZLA5DUSFHHXANCNFSM5KLPY5AQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

bentwonk avatar Dec 25 '21 13:12 bentwonk

up.transactions.list() has the same problem, so I suspect is broken for all. Cannot test others as the don't produce more than a page of data for me

On Sun, Dec 26, 2021 at 12:51 AM ben palmer @.***> wrote:

up.transactions.list()

On Wed, Dec 22, 2021 at 3:24 PM Nathan Dench @.***> wrote:

That's an interesting one @bentwonk https://github.com/bentwonk. It could very well be related to the recent change in pagination. Are you getting previous and next links for any other API calls or is it broken for all of them?

Maybe @IAmMadfly https://github.com/IAmMadfly would be able to shed some more light?

— Reply to this email directly, view it on GitHub https://github.com/ndench/up-bank-api/issues/19#issuecomment-999276307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMQ23IMK25HBB36ZBZLA5DUSFHHXANCNFSM5KLPY5AQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

bentwonk avatar Dec 25 '21 13:12 bentwonk

Have you tried rolling back to version 1.4 or 1.3? I don't have time to fix it right now. I might be able to look into it in a couple of weeks.

Are you able to get an example json response from the API so we can write some tests for it?

ndench avatar Dec 31 '21 22:12 ndench

I might try and write some tests for this library. To check this works. Does it currently use a particular framework?

IAmMadfly avatar Jan 01 '22 07:01 IAmMadfly

I wrote these tests a while ago: https://github.com/ndench/up-bank-api/pull/12 But I'm not set on the framework or approach. Open to some feedback!

ndench avatar Jan 02 '22 01:01 ndench

I've added a CLI command in #21 that you can use to further debug your issue. Using this, I can confirm that calling up.transactions.list() works correctly for me and returns the next page link. It also works for other endpoints as well:

yarn run up transactions list
yarn run up accounts list --pageSize=5

Maybe you could clone my PR and have a play with the CLI command to see what the issue is.

Also, if someone has any insight into the ramifications of changing the "module" option in tsconfig.json that would be great!

ndench avatar Jan 16 '22 06:01 ndench

for anyone wondering, downgrading to version 1.3.0 seems to fix this issue for now. Maybe 1.4.0 could work also.

parth-kulkarni1 avatar Mar 10 '23 12:03 parth-kulkarni1

I have added tests on my own fork. And it seems to be working for me. Can someone run my tests with their own UpBank api key and maybe see if it is an issue of not having a long enough list to trigger it?

fork: https://github.com/IAmMadfly/up-bank-api

to run test, put your API KEY in the environment variable TEST_UPBANK_KEY

IAmMadfly avatar Mar 13 '23 09:03 IAmMadfly