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

Move bank sync payee name normalisation from actual to actual-server #2721

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matt-fidd
Copy link
Contributor

This PR makes the required changes to actual to move the bank sync payee normalisation into actual-server.

Discussion issue: actualbudget/actual-server#348

actual-server PR: actualbudget/actual-server#353

@github-actions github-actions bot changed the title Move bank sync payee name normalisation from actual to actual-server [WIP] Move bank sync payee name normalisation from actual to actual-server May 6, 2024
Copy link

netlify bot commented May 6, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 1cf4f72
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66523747f81cb70008639655
😎 Deploy Preview https://deploy-preview-2721.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@trafico-bot trafico-bot bot added 🚧 WIP Still work-in-progress, please don't review and don't merge 🔍 Ready for Review Pull Request is not reviewed yet and removed 🚧 WIP Still work-in-progress, please don't review and don't merge labels May 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

Bundle Stats — desktop-client

Hey 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

Files count Total bundle size % Changed
9 4.71 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 20.41 kB 0%
static/js/narrow.js 59.97 kB 0%
static/js/wide.js 262.45 kB 0%
static/js/ReportRouter.js 1.23 MB 0%
static/js/index.js 3 MB 0%

Copy link
Contributor

github-actions bot commented May 6, 2024

Bundle Stats — loot-core

Hey 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

Files count Total bundle size % Changed
1 1.2 MB → 1.2 MB (-578 B) -0.05%
Changeset
File Δ Size
packages/loot-core/src/server/accounts/sync.ts 📉 -1.27 kB (-5.76%) 22.04 kB → 20.77 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
kcab.worker.js 1.2 MB → 1.2 MB (-578 B) -0.05%

Unchanged

No assets were unchanged

@trafico-bot trafico-bot bot added 🚧 WIP Still work-in-progress, please don't review and don't merge and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 6, 2024
@matt-fidd matt-fidd changed the title [WIP] Move bank sync payee name normalisation from actual to actual-server Move bank sync payee name normalisation from actual to actual-server May 6, 2024
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed 🚧 WIP Still work-in-progress, please don't review and don't merge labels May 6, 2024
Comment on lines +253 to 255
if (trans.payeeName == null) {
throw new Error('`payeeName` is required when adding a transaction');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This will break SimpleFIN support as it does not provide this field.

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that SimpleFIN seems to provide payee as a field. I am not familiar with the GoCardless side, but could it just be renamed to payee instead of payeeName?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the issue is that the SimpleFIN server code needs to call the moved function and generate a payeeName?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if we'd want to overwrite an field already provided by the APIs, so I added payeeName to the simplefin /transactions endpoint in the actual-server complimentary PR. Could you try running this PR with the server PR (actualbudget/actual-server#353) to confirm if this issue persists?

https://github.com/actualbudget/actual-server/blob/ffdc9684201d3d342dcabf75f23ad8532426b81b/src/app-simplefin/app-simplefin.js#L112

Happy to switch approaches if needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

So something like newTrans.payeeName = formatPayeeName(trans); instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not entirely sure the SimpleFIN transactions will actually change the name via that function, but at least the same code path will run as it does currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, definitely - good spot. Will get the util moved down a directory and call from both.

Copy link
Contributor

Choose a reason for hiding this comment

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

That might also imply the function should live in another folder, instead of under the GoCardless code, since it is shared across two different bank syncs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed in actual-server now, util moved up a directory and run on the simplefin transacion

@trafico-bot trafico-bot bot added ⚠️ Changes requested Pull Request needs changes before it can be reviewed again and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 25, 2024
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed ⚠️ Changes requested Pull Request needs changes before it can be reviewed again labels May 25, 2024
@trafico-bot trafico-bot bot added ⚠️ Changes requested Pull Request needs changes before it can be reviewed again and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 25, 2024
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed ⚠️ Changes requested Pull Request needs changes before it can be reviewed again labels May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 Ready for Review Pull Request is not reviewed yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants