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

Allow setting accessValidForDays and maxHistoricalDays per bank #334

Conversation

kyrias
Copy link
Contributor

@kyrias kyrias commented Apr 8, 2024

Right now this shouldn't actually change anything because the Actual will only try to fetch at most 90 days worth of transactions anyway. I'll file a PR for those changes if this is approved.

I set the values for the existing integrations based on this spreadsheet and these two documentation pages.

@kyrias kyrias force-pushed the gocardless-per-bank-accessValidForDays-maxHistoricalDays branch 2 times, most recently from 687b67a to 6248e9a Compare April 8, 2024 20:41
@kyrias kyrias marked this pull request as ready for review April 8, 2024 20:42
@kyrias
Copy link
Contributor Author

kyrias commented Apr 8, 2024

Actually, there's something strange going on here. I just looked at the requisitions that Actual had previously created and the one from December for one of my banks already had an accessValidForDays of 90, so I think that we're using the API wrong and it's not getting set correctly...

@kyrias
Copy link
Contributor Author

kyrias commented Apr 8, 2024

Ah, seems it was a bug in the nordigen module: nordigen/nordigen-node@5beefda

But uh. We're supposedly using 1.3.0 but the commit that updated the version to 1.3.0 (nordigen/nordigen-node@05d261c) happened after that fix, but the fix doesn't exist in the npm 1.3.0 package? :/

@kyrias
Copy link
Contributor Author

kyrias commented Apr 8, 2024

Yeah, upgrading to 1.4.0 has it, so it seems like 1.3.0 on NPM doesn't at all correspond to their commits that bump the version to 1.3.0, meaning that there is no (public at least) commit of the project which corresponds to the 1.3.0 that's published on NPM. 🙃

I guess I'll update the dependency as well then.

@MatissJanis
Copy link
Member

Has anyone actually reported this issue to GoCardless? I'd be interested to hear back from them (since this causes 500s on their end) before jumping to solutions on our end.

@kyrias
Copy link
Contributor Author

kyrias commented Apr 13, 2024

@MatissJanis What issue?

@MatissJanis
Copy link
Member

#321

@kyrias
Copy link
Contributor Author

kyrias commented Apr 14, 2024

That issue isn't why I did this, but the issue is also misleading because the GoCardless does not return a 500 error, it's the Actual server that does. GoCardless' API returns a correct error saying exactly what's wrong with the request.

@kyrias
Copy link
Contributor Author

kyrias commented Apr 14, 2024

Though I'd also missed that they actually serve the maximum allowed max_historical_days value in their API, so this should be changed to get the correct value from there instead. Annoyingly they do not serve the maximum allowed access_valid_for_days though.

@kyrias kyrias force-pushed the gocardless-per-bank-accessValidForDays-maxHistoricalDays branch from 6e3b56b to 7ea4ade Compare April 14, 2024 11:41
kyrias added 3 commits April 14, 2024 13:48
This also stops taking `accessValidForDays` from the client since it's
hardcoded there anyway and it's simpler to just have these per-bank
values in one place.

Signed-off-by: Johannes Löthberg <[email protected]>
Contrary to the claims in the nordigen-node changelog 1.3.0 did *not*
fix the missing support for passing in accessValidForDays, so we have to
upgrade to 1.4.0 to actually get the fix.

Signed-off-by: Johannes Löthberg <[email protected]>
@kyrias kyrias force-pushed the gocardless-per-bank-accessValidForDays-maxHistoricalDays branch from 7ea4ade to 2e0c6c7 Compare April 14, 2024 11:51
Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@trafico-bot trafico-bot bot added ✅ Approved Pull Request has been approved and can be merged and removed 🔍 Ready for Review labels Apr 14, 2024
@MatissJanis MatissJanis merged commit ae0faf4 into actualbudget:master Apr 14, 2024
6 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved Pull Request has been approved and can be merged labels Apr 14, 2024
@kyrias kyrias deleted the gocardless-per-bank-accessValidForDays-maxHistoricalDays branch April 14, 2024 18:41
joewashear007 pushed a commit to joewashear007/actual-server that referenced this pull request Apr 22, 2024
…albudget#334)

* Allow setting accessValidForDays per bank

This also stops taking `accessValidForDays` from the client since it's
hardcoded there anyway and it's simpler to just have these per-bank
values in one place.

Signed-off-by: Johannes Löthberg <[email protected]>

* Get the max allowed maxHistoricalDays value from the GoCardless API

Signed-off-by: Johannes Löthberg <[email protected]>

* Upgrade nordigen-node to 1.4.0

Contrary to the claims in the nordigen-node changelog 1.3.0 did *not*
fix the missing support for passing in accessValidForDays, so we have to
upgrade to 1.4.0 to actually get the fix.

Signed-off-by: Johannes Löthberg <[email protected]>

---------

Signed-off-by: Johannes Löthberg <[email protected]>
MMichotte pushed a commit to MMichotte/actual-server that referenced this pull request Sep 9, 2024
…albudget#334)

* Allow setting accessValidForDays per bank

This also stops taking `accessValidForDays` from the client since it's
hardcoded there anyway and it's simpler to just have these per-bank
values in one place.

Signed-off-by: Johannes Löthberg <[email protected]>

* Get the max allowed maxHistoricalDays value from the GoCardless API

Signed-off-by: Johannes Löthberg <[email protected]>

* Upgrade nordigen-node to 1.4.0

Contrary to the claims in the nordigen-node changelog 1.3.0 did *not*
fix the missing support for passing in accessValidForDays, so we have to
upgrade to 1.4.0 to actually get the fix.

Signed-off-by: Johannes Löthberg <[email protected]>

---------

Signed-off-by: Johannes Löthberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants