Fix shared error array in SimpleFin batch sync catch block

When simpleFinBatchSync() threw an error, all accounts received the
same errors array by reference and errors accumulated across accounts.
Each account now gets its own isolated errors array with a single error
specific to that account, matching the pattern used by accountsBankSync().

Fixes #6623

https://claude.ai/code/session_011ebiiXRMmbiKxYMohVXL6o
This commit is contained in:
Claude
2026-03-04 13:38:45 +00:00
parent e1e839b5d1
commit 01dbb4169c

View File

@@ -1098,19 +1098,17 @@ async function simpleFinBatchSync({
});
}
} catch (err) {
const errors = [];
for (const account of accounts) {
const error = err as Error;
retVal.push({
accountId: account.id,
res: {
errors,
errors: [handleSyncError(error, account)],
newTransactions: [],
matchedTransactions: [],
updatedAccounts: [],
},
});
const error = err as Error;
errors.push(handleSyncError(error, account));
}
}