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

[Bug]: SimpleFIN throws obtuse error when payment for the subscription has failed #318

Open
1 task done
jhollowe opened this issue Mar 3, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@jhollowe
Copy link

jhollowe commented Mar 3, 2024

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

I had a fully-working SimpleFIN sync setup for several accounts. I accidentally let my SimpleFIN subscription lapse and so simpleFIN stopped returning data and instead returned an error. This is not handled well by the simpleFIN handler which throws a seemingly unrelated error (included below).

This should ideally be gracefully handled and surfaced to the user to inform them of this issue.

What error did you receive?

SimpleFIN returns the following error

$ curl -u 'AUTH_USER_HERE:AUTH_PASS_HERE' https://beta-bridge.simplefin.org/simplefin/accounts
{"errors":["Payment required."],"accounts":[]}

This shows up as the following error in the actual logs as:

Something went wrong TypeError: Cannot read properties of undefined (reading 'balance')
    at file:///app/src/app-simplefin/app-simplefin.js:73:36
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [Function: sendErrorResponse]

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome

Operating System

Windows 10

@jhollowe jhollowe added the bug Something isn't working label Mar 3, 2024
@psybers
Copy link
Contributor

psybers commented Apr 7, 2024

The SimpleFin docs state they will return a 402 "Payment required" in this case. Actual should check for non-200 responses and flag the sync as failing.

@psybers
Copy link
Contributor

psybers commented Apr 7, 2024

See the end of here for their responses: https://www.simplefin.org/protocol.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants