Report failed bank connections and stop resurrecting deleted accounts

Three defects made new connections silently vanish while removed
accounts returned:

- A single shared account the journal cannot represent (securities or
  card entries without IBAN, stable identification or currency) aborted
  the entire consent. Usable accounts are now linked and the rest
  counted and reported.
- A consent that linked nothing was stored, redirected as success and
  later reaped by session recovery. It now fails with the reason.
- Callback failures rendered a bare JSON error page and were never
  logged. They now log and redirect into the app with the reason shown.
- Deleting an account left its session binding, so the next connect or
  sync recovered the binding and re-added the account. Account deletion
  now releases bindings, consents and cursors before committing.
This commit is contained in:
Lars Nolden
2026-09-11 11:46:59 +02:00
parent 3df9bda989
commit e77969b8c5
9 changed files with 242 additions and 34 deletions
+23 -5
View File
@@ -79,14 +79,20 @@ function App() {
const timeout = window.setTimeout(() => setNotice(""), 7000);
return () => window.clearTimeout(timeout);
}, [notice]);
const [connectError, setConnectError] = useState("");
useEffect(() => {
const connected = new URLSearchParams(window.location.search).get(
"connected",
);
if (connected === "1") {
const params = new URLSearchParams(window.location.search);
if (params.get("connected") === "1") {
const unlinkable = Number(params.get("unlinkable") ?? "0");
setNotice(
"Bank authorization completed. Your connection is available in Accounts.",
unlinkable > 0
? `Bank authorization completed. ${unlinkable} shared account${unlinkable === 1 ? "" : "s"} could not be linked (no IBAN or stable identification, or an unsupported currency); the rest are available in Accounts.`
: "Bank authorization completed. Your connection is available in Accounts.",
);
}
const failed = params.get("connect_error");
if (failed) setConnectError(failed);
if (params.get("connected") || failed) {
window.history.replaceState(
null,
"",
@@ -275,6 +281,18 @@ function App() {
</button>
</div>
)}
{connectError && (
<div className="alert error">
<CircleHelp size={19} />
<span>Bank connection failed: {connectError}</span>
<button
className="button subtle"
onClick={() => setConnectError("")}
>
Dismiss
</button>
</div>
)}
{state &&
(state.status.sync_error || state.status.index_error) &&
page !== "settings" && (