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

SimpleFin #2188

Merged
merged 31 commits into from
Jan 20, 2024
Merged

SimpleFin #2188

merged 31 commits into from
Jan 20, 2024

Conversation

zachwhelchel
Copy link
Contributor

@zachwhelchel zachwhelchel commented Jan 7, 2024

SimpleFin can now be configured in the UI and sync transactions, somewhat adjacent to this issue.

There is also a server PR for these changes: actualbudget/actual-server#296

For testing:

  • Run both the server PR and this PR locally.
  • Use this SimpleFIN token for testing: aHR0cHM6Ly9iZXRhLWJyaWRnZS5zaW1wbGVmaW4ub3JnL3NpbXBsZWZpbi9jbGFpbS9ERU1P

For discussion:

  • Should the syncing logic be in the app? Or on the server? GoCardless has the transactions returned from the server and all the merging/adding/etc happens in the app. I followed the same strategy. But you could make a case this could happen on the server? Then you could use a cron job to do this nightly. I didn't go that route because I assumed the logic in the app for GoCardless was more "prod ready" compared to the script that uses the actual-api for import. I also struggled with how I would adapt that code to work on the server. Here is the script that uses the api (and informed a lot this PR's changes as well): https://github.com/duplaja/actual-simplefin-sync/

Still to be addressed:

  • Unlinking and relinking accounts not yet supported (only new accounts work currently).
  • Unlinking needs to remove the account_sync_source.
  • GoCardless needs to set the account_sync_source as well.
  • The UI for adding the SimpleFin token doesn't advance correctly, exit the flow and restart it for now.
  • Mask & Official Name might not be supported like they are in GoCardless, decide how to handle this (Look for //TODO: Do we have this?).
  • When you go to link an account with SimpleFin after the token has been set the loading is slow and has no indicator. Also, could we speed up the call by looking for less transactions (since they aren't needed at this point).
  • Need to add release notes. Make sure to credit those who worked on the SimpleFin script I incorporated also.

Here are some screenshots of the UI currently:
Screenshot 2024-01-06 at 8 02 53 PM
Screenshot 2024-01-05 at 8 03 21 PM
Screenshot 2024-01-06 at 12 26 16 PM

Copy link

netlify bot commented Jan 7, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 4c325fa
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/65ac44002df780000855a56f
😎 Deploy Preview https://deploy-preview-2188.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.

@zachwhelchel zachwhelchel changed the title SimpleFin [WIP] SimpleFin Jan 7, 2024
@trafico-bot trafico-bot bot added 🚧 WIP and removed 🚧 WIP labels Jan 7, 2024
@zachwhelchel zachwhelchel changed the title [WIP] SimpleFin SimpleFin Jan 7, 2024
@zachwhelchel zachwhelchel changed the title SimpleFin [WIP] SimpleFin Jan 7, 2024
@youngcw
Copy link
Member

youngcw commented Jan 8, 2024

connected to #737

@youngcw
Copy link
Member

youngcw commented Jan 11, 2024

Does simplefin have developer credentials for testing?

@zachwhelchel
Copy link
Contributor Author

Does simplefin have developer credentials for testing?

Yep:
aHR0cHM6Ly9iZXRhLWJyaWRnZS5zaW1wbGVmaW4ub3JnL3NpbXBsZWZpbi9jbGFpbS9ERU1P

Copy link
Contributor

github-actions bot commented Jan 11, 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
10 5.09 MB → 5.09 MB (+7.27 kB) +0.14%
Changeset
File Δ Size
src/components/modals/SimpleFinInitialise.tsx 🆕 +2.3 kB 0 B → 2.3 kB
src/hooks/useSimpleFinStatus.ts 🆕 +589 B 0 B → 589 B
src/components/modals/CreateAccount.tsx 📈 +3.41 kB (+74.14%) 4.6 kB → 8.02 kB
src/hooks/useGoCardlessStatus.ts 📈 +40 B (+7.21%) 555 B → 595 B
src/hooks/useFeatureFlag.ts 📈 +24 B (+6.30%) 381 B → 405 B
home/runner/work/actual/actual/packages/loot-core/src/client/actions/account.ts 📈 +261 B (+6.08%) 4.19 kB → 4.45 kB
src/components/settings/Experimental.tsx 📈 +145 B (+4.69%) 3.02 kB → 3.16 kB
src/gocardless.ts 📈 +34 B (+3.70%) 920 B → 954 B
src/components/modals/SelectLinkedAccounts.jsx 📈 +210 B (+3.58%) 5.73 kB → 5.93 kB
src/components/Modals.tsx 📈 +279 B (+3.35%) 8.13 kB → 8.4 kB
src/components/modals/GoCardlessExternalMsg.tsx 📈 +10 B (+0.10%) 9.7 kB → 9.71 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 2.63 MB → 2.64 MB (+7.27 kB) +0.27%

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/ButtonLink.js 379 B 0%
static/js/narrow.js 82.17 kB 0%
static/js/BalanceTooltip.js 6.07 kB 0%
static/js/FiltersMenu.js 28.92 kB 0%
static/js/wide.js 239.01 kB 0%
static/js/ReportRouter.js 1.95 MB 0%

Copy link
Contributor

github-actions bot commented Jan 11, 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.24 MB → 1.24 MB (+2 kB) +0.16%
Changeset
File Δ Size
packages/loot-core/src/server/server-config.ts 📈 +58 B (+7.82%) 742 B → 800 B
packages/loot-core/src/server/accounts/sync.ts 📈 +1.2 kB (+3.89%) 30.84 kB → 32.04 kB
packages/loot-core/src/server/main.ts 📈 +2.23 kB (+3.51%) 63.75 kB → 65.98 kB
packages/loot-core/src/server/aql/schema/index.ts 📈 +42 B (+0.30%) 13.69 kB → 13.73 kB
packages/loot-core/src/server/accounts/link.ts 📉 -2 B (-0.05%) 4.02 kB → 4.02 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.24 MB → 1.24 MB (+2 kB) +0.16%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@zachwhelchel zachwhelchel changed the title [WIP] SimpleFin SimpleFin Jan 11, 2024
@zachwhelchel
Copy link
Contributor Author

@joel-jeremy @youngcw @MatissJanis this should be all buttoned up and ready for review again.

joel-jeremy
joel-jeremy previously approved these changes Jan 19, 2024

setIsLoading(true);

await Promise.all([
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need the Promise.all here but other than that LGTM! Thank you! :)

@MatissJanis MatissJanis removed their request for review January 19, 2024 09:19
@carkom
Copy link
Contributor

carkom commented Jan 19, 2024

Great addition. Thanks for the contribution!

@joel-jeremy joel-jeremy merged commit 7518618 into actualbudget:master Jan 20, 2024
19 checks passed
@trafico-bot trafico-bot bot added the ✨ Merged Pull Request has been merged successfully label Jan 20, 2024
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
* Some initial UI work for adding SimpleFin.

* SimpleFin proof of concept working.

* Adds linking & unlinking to existing accounts through the account menu UI.

* Added loading and lint fixes.

* Lint changes.

* Added release notes.

* Typecheck cleanup.

* Import, lint, typecheck cleanups.

* More typecheck cleanup.

* Refactored language for consistency.

* Added default institution name.

* Lint cleanup.

* Addressed change requests.

* Added a default to migration, made variables consistent, added feature flag.

* Added account_sync_source to server schema.

* Adds account_sync_source to test.

* Fix for typecheck.

* Attempt to make typecheck happy.

* Added strict ignore.

* Moved account_sync_source to the right model (face palm).

* Hotfix for institution format.

* Lint cleanup.

* Removed unnecessary promise.all.

* Lint cleanup.
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.

5 participants