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

[WIP] Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state #2739

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mattpetters
Copy link


category: Bugfix
authors: [mattpetters]

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

@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label May 11, 2024
@github-actions github-actions bot changed the title Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state [WIP] Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state May 11, 2024
@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 11, 2024
Copy link

netlify bot commented May 11, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit b8e02d9
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66452c8de2369a0007ee57bf
😎 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.

Copy link
Contributor

github-actions bot commented May 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
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/narrow.js 59.97 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 20.54 kB 0%
static/js/wide.js 261.78 kB 0%
static/js/ReportRouter.js 1.23 MB 0%

Copy link
Contributor

github-actions bot commented May 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.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%

@mattpetters mattpetters changed the title [WIP] Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state May 11, 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 11, 2024
@mattpetters mattpetters force-pushed the bugfix/simplefin-credential-reset branch from e0fad66 to 0d33a45 Compare May 11, 2024 21:17
@psybers
Copy link
Contributor

psybers commented May 14, 2024

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.

@mattpetters
Copy link
Author

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.

@psybers
Copy link
Contributor

psybers commented May 14, 2024

image

Seems like a good fit here.

@mattpetters
Copy link
Author

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 mattpetters force-pushed the bugfix/simplefin-credential-reset branch from 0f523c1 to 89ca7bc Compare May 14, 2024 23:25
@mattpetters
Copy link
Author

whoops, linter fail

@mattpetters mattpetters force-pushed the bugfix/simplefin-credential-reset branch from 4c8a641 to 998b4af Compare May 15, 2024 02:13
@mattpetters
Copy link
Author

@psybers ready for another look whenever :)

Comment on lines 46 to 47
<strong>Reset SimpleFIN Credential</strong> In some cases (like
importing from an existing database to a new instance), you may need
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit of a nit, but the other settings incorporate the bolded text into the first sentence. Here it is acting more like a heading. Can you reword the text? Something like:

<strong>Reset SimpleFIN credential</strong> if you are having trouble accessing SimpleFIN. ...

@psybers
Copy link
Contributor

psybers commented May 15, 2024

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.

@mattpetters
Copy link
Author

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 mattpetters force-pushed the bugfix/simplefin-credential-reset branch from 03b53e3 to b8e02d9 Compare May 15, 2024 21:43
@mattpetters mattpetters requested a review from psybers May 15, 2024 21:44
@mattpetters
Copy link
Author

@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
Copy link
Author

@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?

@psybers
Copy link
Contributor

psybers commented May 16, 2024

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

@psybers
Copy link
Contributor

psybers commented May 16, 2024

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

@mattpetters mattpetters changed the title Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state [WIP] Bugfix: add reset SimpleFIN credential button to escape SimpleFIN broken/unable to sync state May 16, 2024
@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 16, 2024
@MatissJanis
Copy link
Member

👋 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

@psybers
Copy link
Contributor

psybers commented May 16, 2024

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

image

@MatissJanis
Copy link
Member

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.

@psybers
Copy link
Contributor

psybers commented May 17, 2024

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?

@mattpetters
Copy link
Author

mattpetters commented May 18, 2024

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 ;)

@psybers
Copy link
Contributor

psybers commented May 18, 2024

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

image

@MatissJanis
Copy link
Member

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

@psybers
Copy link
Contributor

psybers commented May 18, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 WIP Still work-in-progress, please don't review and don't merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants