-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
🧹 optimise GoCardless bank sync to use fewer api calls #3279
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller
Unchanged No assets were unchanged |
const { | ||
transactions: { all }, | ||
balances, | ||
startingBalance, | ||
} = res; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question as below, why not just build what we want to return and then return res
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer it in this case to the alternative:
return {
transactions: res.transactions.all,
accountBalance: res.balances,
startingBalance: res.startingBalance,
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also want to log the original res
out for debugging purposes
Any reason why you removed the accountBalance from SimpleFin transactions? I download that in my instance and add it to the account notes. It's a great way to see what my balance is and to reconcile my transactions. |
Yes, it wasn't used anywhere in the code base. |
Part of actualbudget/actual-server#431
Complimentary PR to actualbudget/actual-server#436
The balance fetched from GoCardless is used to calculate the starting balance, which is only relevant when a completely blank account is synced. This change reduces the amount of API calls per sync, once the account has had a starting balance set, to 1 - maximising the new 10 requests/day rate limit coming on the 19th.