actual icon indicating copy to clipboard operation
actual copied to clipboard

Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state

Open mattpetters opened this issue 9 months ago • 10 comments


category: Bugfix authors: [mattpetters]

Add reset SimpleFIN credential button to resolve a state in which SimpleFIN is unable to sync

mattpetters avatar May 11 '24 18:05 mattpetters

Deploy Preview for actualbudget ready!

Name Link
Latest commit 541b68b23ae9d56cd30363df67ec0b24e10fb943
Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/665229ef41d1d2000844e18a
Deploy Preview https://deploy-preview-2739.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.

netlify[bot] avatar May 11 '24 18:05 netlify[bot]

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 → 4.72 MB (+1.97 kB) +0.04%
Changeset
File Δ Size
src/components/settings/SimpleFINReset.tsx 🆕 +1.79 kB 0 B → 1.79 kB
src/components/settings/index.tsx 📈 +177 B (+2.92%) 5.93 kB → 6.1 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3 MB → 3 MB (+1.97 kB) +0.06%

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%

github-actions[bot] avatar May 11 '24 18:05 github-actions[bot]

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 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
kcab.worker.js 1.2 MB 0%

github-actions[bot] avatar May 11 '24 18:05 github-actions[bot]

Thanks for adding this, I know lots of people have requested it!

It feels quite out of place where you put it though. To me, it would make more sense in the Advanced Settings screen with the other reset/repair buttons.

psybers avatar May 14 '24 22:05 psybers

Thanks for adding this, I know lots of people have requested it!

It feels quite out of place where you put it though. To me, it would make more sense in the Advanced Settings screen with the other reset/repair buttons.

I actually slept on it and had this same thought, let me move it and I'll update the PR.

mattpetters avatar May 14 '24 22:05 mattpetters

image

Seems like a good fit here.

psybers avatar May 14 '24 23:05 psybers

yup

image Seems like a good fit here.

yup, I did more or less the same thing. Feel free to take a look now and lmk if anything else needs maneuvering

mattpetters avatar May 14 '24 23:05 mattpetters

whoops, linter fail

mattpetters avatar May 14 '24 23:05 mattpetters

@psybers ready for another look whenever :)

mattpetters avatar May 15 '24 02:05 mattpetters

I was not able to actually test the code, as I did not want to deal with resetting my token and do not have time to set up a second/test server.

psybers avatar May 15 '24 16:05 psybers

I was not able to actually test the code, as I did not want to deal with resetting my token and do not have time to set up a second/test server.

Probably a hint that I should be updating the docs too. ;)

On SimpleFIN Bridge, you can add multiple "Apps" that all link to your same account: Screenshot 2024-05-15 at 2 38 03 PM Screenshot 2024-05-15 at 2 38 18 PM

Creating that Setup Token will generate the setup token you can enter into the "init" part of the setup and it basically is just a new auth credential to allow you to access your existing SimpleFIN accounts. To my knowledge it should not affect your linked accounts, it's just changing your credential to auth with SimpleFIN.

@psybers

mattpetters avatar May 15 '24 21:05 mattpetters

@psybers actually hold off on this one, I'm going to run some tests of my own and maybe try to write automated tests as well. might not be able to be done done for another day or two

mattpetters avatar May 15 '24 22:05 mattpetters

@psybers the more I sit with this, the more I'm thinking the right way to implement this is to actually have this button hit the server and have the server clear the rows instead of just trying to overwrite by forcing setup again. What do you think?

mattpetters avatar May 15 '24 22:05 mattpetters

@mattpetters I'd suggest throwing a "[WIP]" tag on the PR title while you decide the best course.

psybers avatar May 16 '24 05:05 psybers

Since you are rethinking it, maybe look at how the GoCardless sync handles the reset. I believe it has similar functionality: https://discord.com/channels/937901803608096828/940290142579605514/1232681744780759041

psybers avatar May 16 '24 08:05 psybers

👋 We're quite selective about what goes in the "settings" page as we don't want it to get cluttered with all sorts of switches/toggles/buttons. Just the most crucial things.

Take a look at how it's done for gocardless. Ideally we should follow the same pattern for SimpleFin too:

Screenshot 2024-05-16 at 21 38 28 Screenshot 2024-05-16 at 21 40 10

MatissJanis avatar May 16 '24 20:05 MatissJanis

We could add a 3-dot menu to the right of the "Link accounts" button:

image

psybers avatar May 16 '24 21:05 psybers

We could add a 3-dot menu to the right of the "Link accounts" button:

Has to be earlier than that IMO. If you currently mis-configure the keys - you won't be able to access the "link accounts" modal. Meaning you wouldn't be able to change the keys.

MatissJanis avatar May 17 '24 18:05 MatissJanis

Would it make sense to move the GoCardless one, so then both would be on the initial 'create account' dialog? Can put two menus there, and maybe only show them if credentials are already configured?

psybers avatar May 17 '24 19:05 psybers

I think my initial impl was something similar to that with the reset button below the regular button. Initially I just did that for convenience (everything I wanted to call was right there) but maybe it could have just been refactored to a) be less obtrusive similar to the 3 dot menu and b) only show conditionally as you're suggesting.

PS I should have time to work on this a bit more at some point this weekend so if you guys come upon a design I'll get on it then. And of course feel free to take the reins if you want ;)

mattpetters avatar May 18 '24 06:05 mattpetters

Maybe something like this? @MatissJanis what do you think?

image

psybers avatar May 18 '24 15:05 psybers

I think that looks good (just need to vertically align the "..." menu with the button)!

MatissJanis avatar May 18 '24 20:05 MatissJanis

@mattpetters Feel free to use this as a starting point:

https://github.com/psybers/actual/tree/reset-sync

psybers avatar May 18 '24 21:05 psybers

👋 just checking in: is this ready for review? If so - would you mind removing the "WIP" prefix from the PR? That lets us know this is ready.

MatissJanis avatar May 29 '24 18:05 MatissJanis

@MatissJanis Since this PR still implements it via the settings page, I would guess it is a WIP.

psybers avatar May 29 '24 19:05 psybers

Closing in favor of #2870. Thanks for getting this started.

youngcw avatar Jun 18 '24 18:06 youngcw