Repository navigation
Surface SimpleFIN connection warnings that need re-auth - #13
Merged
Merged
Conversation
A bank connection can lapse (e.g. Apple Card, which updates monthly) and
SimpleFIN then returns a per-connection warning in the accounts response.
Those warnings were fetched and stored but never shown, so a stale account
could silently stop updating.
Surface them the way the SimpleFIN developer guide requires ("always show
those errors to your end users"): an always-visible amber banner and an
Accounts-tab badge reflect the combined errors/errlist count and are
bootstrapped on load, so the warning is loud from any tab. The Accounts view
lists each affected connection with instructions to reconnect it in the
SimpleFIN Bridge, since this read-only app cannot re-authorize a bank itself.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surfaces SimpleFIN connection problems (a bank that stopped updating and needs
re-authorization, e.g. a stale Apple Card connection) in the web UI. These were
fetched from the SimpleFIN Bridge but never shown to the user, so a connection
could silently stop updating with no warning. The SimpleFIN developer guide
explicitly requires always showing these errors to the end user.
What changed
#connBanner) + an Accounts-tab badge,bootstrapped by a
/api/accountsfetch on load, so the warning is loud fromwhatever tab is restored, not only the Accounts view.
notices based on the remediation the user actually needs:
con.*) and legacy code-less errors: aspecific bank must be reconnected in the SimpleFIN Bridge.
gen.auth: finance-mcp's own SimpleFIN access URL is no longerauthorized; re-add the app / claim a new setup token (not a per-bank
reconnect).
act.*), developer (gen.api), and othercodes that clear on the next sync.
connErrorsnormalizes the SimpleFIN error model: prefers the structurederrlist(v2) over the deprecatederrorsstrings (v1) so one problem is notcounted twice, reads the required
msgdisplay field, and dedupes on the fullidentity
(code, conn_id, account_id, msg).connErrorKindclassifies by error-code prefix, honoring the spec'sunknown-subcode-falls-back-to-prefix rule.
sync.py: a long sync spans multiple ~90-day windowsand a persistent per-connection error was accumulated once per window. Added
_dedupe_errors()(applied before caching and in the returned summary) keyedon the same identity as the UI, plus
_hashable()so a malformed upstreamentry can't crash the whole sync.
Tests
test_connection_errors_surface_from_any_tab)to pin prefer-
errlist, themsgfield, the full-identity dedup key, and thethree-way
connErrorKindclassification.test_dedupe_errors_drops_repeats_preserving_order,test_sync_dedupes_persistent_error_across_windows, andtest_dedupe_errors_handles_unhashable_fields.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com