[PR #7125] [MERGED] Fix shared error array in SimpleFin batch sync error handling #37148

Closed
opened 2026-04-20 23:56:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7125
Author: @MatissJanis
Created: 3/4/2026
Status: Merged
Merged: 3/9/2026
Merged by: @MatissJanis

Base: masterHead: claude/analyze-internal-errors-4k6O2


📝 Commits (5)

  • e1e839b Add failing tests for SimpleFin batch sync shared error array bug
  • 01dbb41 Fix shared error array in SimpleFin batch sync catch block
  • 715d17f Remove @ts-strict-ignore from bank sync tests
  • cc4d640 Add release notes for PR #7125
  • 4e2f4ff [AI] Replace test() with it() to follow repo convention

📊 Changes

3 files changed (+144 additions, -4 deletions)

View changed files

packages/loot-core/src/server/accounts/app-bank-sync.test.ts (+136 -0)
📝 packages/loot-core/src/server/accounts/app.ts (+2 -4)
upcoming-release-notes/7125.md (+6 -0)

📄 Description

Description

Fixes a bug in the SimpleFin batch sync error handling where all accounts were sharing a single errors array when a batch sync operation failed. This caused each account to receive all errors instead of just its own error.

The issue was that the errors array was declared once outside the loop and then reused for all accounts. The fix moves the error array creation inside the loop so each account gets its own isolated errors array with only its own error.

https://github.com/actualbudget/actual/issues/6623
https://github.com/actualbudget/actual/issues/6651
https://github.com/actualbudget/actual/issues/7114
https://github.com/actualbudget/actual/issues/7133

Testing

Added comprehensive unit tests in app-bank-sync.test.ts that verify:

  • Each account receives its own isolated errors array (not shared references)
  • Each account receives exactly one error when batch sync fails, not N errors (where N is the number of accounts)
  • Each error references only the account it belongs to
  • Per-account errors in the response only affect that specific account

The tests confirm the fix resolves the shared array issue.

Checklist

  • Release notes added
  • No obvious regressions in affected areas
  • Self-review has been performed - Error handling now correctly isolates errors per account instead of sharing a single array

https://claude.ai/code/session_011ebiiXRMmbiKxYMohVXL6o


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.89 MB → 14.89 MB (-1.15 kB) -0.01%
loot-core 1 5.82 MB → 5.82 MB (-48 B) -0.00%
api 1 4.43 MB → 4.43 MB (-40 B) -0.00%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.89 MB → 14.89 MB (-1.15 kB) -0.01%
Changeset
File Δ Size
locale/pl.json 📈 +985 B (+1.09%) 88.37 kB → 89.33 kB
locale/en.json 📈 +88 B (+0.05%) 170.33 kB → 170.42 kB
locale/ca.json 📉 -185 B (-0.10%) 188.11 kB → 187.93 kB
locale/de.json 📉 -183 B (-0.10%) 180.07 kB → 179.89 kB
locale/nb-NO.json 📉 -166 B (-0.10%) 156.96 kB → 156.8 kB
locale/it.json 📉 -182 B (-0.10%) 171.16 kB → 170.98 kB
locale/es.json 📉 -186 B (-0.10%) 174.55 kB → 174.37 kB
locale/uk.json 📉 -232 B (-0.11%) 214.88 kB → 214.65 kB
locale/fr.json 📉 -194 B (-0.11%) 179.6 kB → 179.41 kB
locale/nl.json 📉 -156 B (-0.13%) 113.21 kB → 113.06 kB
locale/da.json 📉 -158 B (-0.15%) 106.35 kB → 106.2 kB
locale/th.json 📉 -303 B (-0.16%) 181.87 kB → 181.58 kB
locale/pt-BR.json 📉 -307 B (-0.16%) 183.19 kB → 182.89 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/pl.js 88.37 kB → 89.33 kB (+985 B) +1.09%
static/js/en.js 170.33 kB → 170.42 kB (+88 B) +0.05%

Smaller

Asset File Size % Changed
static/js/pt-BR.js 183.19 kB → 182.89 kB (-307 B) -0.16%
static/js/th.js 181.87 kB → 181.58 kB (-303 B) -0.16%
static/js/uk.js 214.88 kB → 214.65 kB (-232 B) -0.11%
static/js/fr.js 179.6 kB → 179.41 kB (-194 B) -0.11%
static/js/es.js 174.55 kB → 174.37 kB (-186 B) -0.10%
static/js/ca.js 188.11 kB → 187.93 kB (-185 B) -0.10%
static/js/de.js 180.07 kB → 179.89 kB (-183 B) -0.10%
static/js/it.js 171.16 kB → 170.98 kB (-182 B) -0.10%
static/js/nb-NO.js 156.96 kB → 156.8 kB (-166 B) -0.10%
static/js/da.js 106.35 kB → 106.2 kB (-158 B) -0.15%
static/js/nl.js 113.21 kB → 113.06 kB (-156 B) -0.13%

Unchanged

Asset File Size % Changed
static/js/index.js 9.54 MB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.16 MB 0%
static/js/narrow.js 638.11 kB 0%
static/js/TransactionList.js 106.22 kB 0%
static/js/wide.js 164.15 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.04 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.82 MB → 5.82 MB (-48 B) -0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts 📉 -48 B (-0.17%) 27.27 kB → 27.22 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.DltpED-u.js 0 B → 5.82 MB (+5.82 MB) -

Removed

Asset File Size % Changed
kcab.worker.MNtpiHkH.js 5.82 MB → 0 B (-5.82 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.43 MB → 4.43 MB (-40 B) -0.00%
Changeset
File Δ Size
src/server/accounts/app.ts 📉 -40 B (-0.17%) 23.29 kB → 23.26 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
bundle.api.js 4.43 MB → 4.43 MB (-40 B) -0.00%

Unchanged
No assets were unchanged


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/7125 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `claude/analyze-internal-errors-4k6O2` --- ### 📝 Commits (5) - [`e1e839b`](https://github.com/actualbudget/actual/commit/e1e839b5d150b587ce5632dbfcaa9aede4161fc4) Add failing tests for SimpleFin batch sync shared error array bug - [`01dbb41`](https://github.com/actualbudget/actual/commit/01dbb4169c8f383dc6da63b03fd68ef676427d8c) Fix shared error array in SimpleFin batch sync catch block - [`715d17f`](https://github.com/actualbudget/actual/commit/715d17f23278f5b2310b710913862ac4b82167a7) Remove @ts-strict-ignore from bank sync tests - [`cc4d640`](https://github.com/actualbudget/actual/commit/cc4d640cf73dff58bd881f5eda60ef79efadab21) Add release notes for PR #7125 - [`4e2f4ff`](https://github.com/actualbudget/actual/commit/4e2f4ffdcb3f74e7d01615ac0ec1b93195fd84ef) [AI] Replace test() with it() to follow repo convention ### 📊 Changes **3 files changed** (+144 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `packages/loot-core/src/server/accounts/app-bank-sync.test.ts` (+136 -0) 📝 `packages/loot-core/src/server/accounts/app.ts` (+2 -4) ➕ `upcoming-release-notes/7125.md` (+6 -0) </details> ### 📄 Description ## Description Fixes a bug in the SimpleFin batch sync error handling where all accounts were sharing a single `errors` array when a batch sync operation failed. This caused each account to receive all errors instead of just its own error. The issue was that the `errors` array was declared once outside the loop and then reused for all accounts. The fix moves the error array creation inside the loop so each account gets its own isolated errors array with only its own error. ## Related issue(s) https://github.com/actualbudget/actual/issues/6623 https://github.com/actualbudget/actual/issues/6651 https://github.com/actualbudget/actual/issues/7114 https://github.com/actualbudget/actual/issues/7133 ## Testing Added comprehensive unit tests in `app-bank-sync.test.ts` that verify: - Each account receives its own isolated errors array (not shared references) - Each account receives exactly one error when batch sync fails, not N errors (where N is the number of accounts) - Each error references only the account it belongs to - Per-account errors in the response only affect that specific account The tests confirm the fix resolves the shared array issue. ## Checklist - [x] Release notes added - [x] No obvious regressions in affected areas - [x] Self-review has been performed - Error handling now correctly isolates errors per account instead of sharing a single array https://claude.ai/code/session_011ebiiXRMmbiKxYMohVXL6o <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.89 MB → 14.89 MB (-1.15 kB) | -0.01% loot-core | 1 | 5.82 MB → 5.82 MB (-48 B) | -0.00% api | 1 | 4.43 MB → 4.43 MB (-40 B) | -0.00% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.89 MB → 14.89 MB (-1.15 kB) | -0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `locale/pl.json` | 📈 +985 B (+1.09%) | 88.37 kB → 89.33 kB `locale/en.json` | 📈 +88 B (+0.05%) | 170.33 kB → 170.42 kB `locale/ca.json` | 📉 -185 B (-0.10%) | 188.11 kB → 187.93 kB `locale/de.json` | 📉 -183 B (-0.10%) | 180.07 kB → 179.89 kB `locale/nb-NO.json` | 📉 -166 B (-0.10%) | 156.96 kB → 156.8 kB `locale/it.json` | 📉 -182 B (-0.10%) | 171.16 kB → 170.98 kB `locale/es.json` | 📉 -186 B (-0.10%) | 174.55 kB → 174.37 kB `locale/uk.json` | 📉 -232 B (-0.11%) | 214.88 kB → 214.65 kB `locale/fr.json` | 📉 -194 B (-0.11%) | 179.6 kB → 179.41 kB `locale/nl.json` | 📉 -156 B (-0.13%) | 113.21 kB → 113.06 kB `locale/da.json` | 📉 -158 B (-0.15%) | 106.35 kB → 106.2 kB `locale/th.json` | 📉 -303 B (-0.16%) | 181.87 kB → 181.58 kB `locale/pt-BR.json` | 📉 -307 B (-0.16%) | 183.19 kB → 182.89 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/pl.js | 88.37 kB → 89.33 kB (+985 B) | +1.09% static/js/en.js | 170.33 kB → 170.42 kB (+88 B) | +0.05% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/pt-BR.js | 183.19 kB → 182.89 kB (-307 B) | -0.16% static/js/th.js | 181.87 kB → 181.58 kB (-303 B) | -0.16% static/js/uk.js | 214.88 kB → 214.65 kB (-232 B) | -0.11% static/js/fr.js | 179.6 kB → 179.41 kB (-194 B) | -0.11% static/js/es.js | 174.55 kB → 174.37 kB (-186 B) | -0.10% static/js/ca.js | 188.11 kB → 187.93 kB (-185 B) | -0.10% static/js/de.js | 180.07 kB → 179.89 kB (-183 B) | -0.10% static/js/it.js | 171.16 kB → 170.98 kB (-182 B) | -0.10% static/js/nb-NO.js | 156.96 kB → 156.8 kB (-166 B) | -0.10% static/js/da.js | 106.35 kB → 106.2 kB (-158 B) | -0.15% static/js/nl.js | 113.21 kB → 113.06 kB (-156 B) | -0.13% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.54 MB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.16 MB | 0% static/js/narrow.js | 638.11 kB | 0% static/js/TransactionList.js | 106.22 kB | 0% static/js/wide.js | 164.15 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.04 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.82 MB → 5.82 MB (-48 B) | -0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts` | 📉 -48 B (-0.17%) | 27.27 kB → 27.22 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DltpED-u.js | 0 B → 5.82 MB (+5.82 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.MNtpiHkH.js | 5.82 MB → 0 B (-5.82 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.43 MB → 4.43 MB (-40 B) | -0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/server/accounts/app.ts` | 📉 -40 B (-0.17%) | 23.29 kB → 23.26 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.43 MB → 4.43 MB (-40 B) | -0.00% **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 23:56:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#37148