[PR #7185] [MERGED] [AI] fix: preserve explicit category on imported transactions #21355

Closed
opened 2026-04-14 22:02:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7185
Author: @api2062
Created: 3/13/2026
Status: Merged
Merged: 3/23/2026
Merged by: @matt-fidd

Base: masterHead: api2062/7171


📝 Commits (2)

  • 8779b64 [AI] fix: preserve explicit transaction fields in addTransactions
  • 6e808c5 [AI] add release notes for PR #7185

📊 Changes

3 files changed (+66 additions, -3 deletions)

View changed files

📝 packages/loot-core/src/server/accounts/sync.test.ts (+40 -0)
📝 packages/loot-core/src/server/accounts/sync.ts (+20 -3)
upcoming-release-notes/7185.md (+6 -0)

📄 Description

Description

Preserve explicitly provided transaction fields when importing via addTransactions.

Rules should enrich missing values, but should not overwrite values provided by the API payload. This fixes cases where an incoming transaction category is replaced by a matching rule category.

Fixes #7171

Testing

  • node .yarn/releases/yarn-4.10.3.cjs workspace loot-core test:node src/server/accounts/sync.test.ts --testNamePattern "addTransactions does not override explicitly provided category"
  • Added regression test that sets a payee-based category rule and verifies an explicitly provided category remains unchanged.

Checklist

  • Release notes added (will add upcoming-release-notes/<PR_NUMBER>.md after PR number is assigned)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.92 MB 0%
loot-core 1 5.83 MB → 5.83 MB (+415 B) +0.01%
api 3 4.82 MB → 4.82 MB (+375 B) +0.01%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.92 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 9.57 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/ca.js 187.85 kB 0%
static/js/da.js 106.13 kB 0%
static/js/de.js 179.82 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 171.21 kB 0%
static/js/es.js 174.29 kB 0%
static/js/fr.js 179.34 kB 0%
static/js/it.js 170.91 kB 0%
static/js/nb-NO.js 156.74 kB 0%
static/js/nl.js 113.03 kB 0%
static/js/pl.js 89.61 kB 0%
static/js/pt-BR.js 182.82 kB 0%
static/js/th.js 181.54 kB 0%
static/js/uk.js 215.25 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.48 kB 0%
static/js/wide.js 164.15 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 11.57 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.83 MB → 5.83 MB (+415 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts 📈 +415 B (+1.48%) 27.42 kB → 27.82 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.C0A1M2dG.js 0 B → 5.83 MB (+5.83 MB) -

Removed

Asset File Size % Changed
kcab.worker.CYweGG8f.js 5.83 MB → 0 B (-5.83 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
3 4.82 MB → 4.82 MB (+375 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts 📈 +375 B (+1.50%) 24.49 kB → 24.86 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 4.53 MB → 4.53 MB (+375 B) +0.01%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
index-BKGP2w5F.js 285.56 kB 0%
multipart-parser-DwddZ4BH.js 9.33 kB 0%

🔄 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/7185 **Author:** [@api2062](https://github.com/api2062) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/23/2026 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `api2062/7171` --- ### 📝 Commits (2) - [`8779b64`](https://github.com/actualbudget/actual/commit/8779b641584ba9badbe2e204e4949d1ee239f39b) [AI] fix: preserve explicit transaction fields in addTransactions - [`6e808c5`](https://github.com/actualbudget/actual/commit/6e808c5f793453b6e8d5acb586ab75b9b463f668) [AI] add release notes for PR #7185 ### 📊 Changes **3 files changed** (+66 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/accounts/sync.test.ts` (+40 -0) 📝 `packages/loot-core/src/server/accounts/sync.ts` (+20 -3) ➕ `upcoming-release-notes/7185.md` (+6 -0) </details> ### 📄 Description ## Description Preserve explicitly provided transaction fields when importing via `addTransactions`. Rules should enrich missing values, but should not overwrite values provided by the API payload. This fixes cases where an incoming transaction category is replaced by a matching rule category. ## Related issue(s) Fixes #7171 ## Testing - `node .yarn/releases/yarn-4.10.3.cjs workspace loot-core test:node src/server/accounts/sync.test.ts --testNamePattern "addTransactions does not override explicitly provided category"` - Added regression test that sets a payee-based category rule and verifies an explicitly provided category remains unchanged. ## Checklist - [ ] Release notes added (will add `upcoming-release-notes/<PR_NUMBER>.md` after PR number is assigned) - [x] No obvious regressions in affected areas - [x] Self-review has been performed - I understand what each change in the code does and why it is needed <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.92 MB | 0% loot-core | 1 | 5.83 MB → 5.83 MB (+415 B) | +0.01% api | 3 | 4.82 MB → 4.82 MB (+375 B) | +0.01% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.92 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.57 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/ca.js | 187.85 kB | 0% static/js/da.js | 106.13 kB | 0% static/js/de.js | 179.82 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 171.21 kB | 0% static/js/es.js | 174.29 kB | 0% static/js/fr.js | 179.34 kB | 0% static/js/it.js | 170.91 kB | 0% static/js/nb-NO.js | 156.74 kB | 0% static/js/nl.js | 113.03 kB | 0% static/js/pl.js | 89.61 kB | 0% static/js/pt-BR.js | 182.82 kB | 0% static/js/th.js | 181.54 kB | 0% static/js/uk.js | 215.25 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.48 kB | 0% static/js/wide.js | 164.15 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 11.57 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.83 MB → 5.83 MB (+415 B) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts` | 📈 +415 B (+1.48%) | 27.42 kB → 27.82 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.C0A1M2dG.js | 0 B → 5.83 MB (+5.83 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CYweGG8f.js | 5.83 MB → 0 B (-5.83 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 ----------- | ----------------- | --------- 3 | 4.82 MB → 4.82 MB (+375 B) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts` | 📈 +375 B (+1.50%) | 24.49 kB → 24.86 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 ----- | --------- | --------- index.js | 4.53 MB → 4.53 MB (+375 B) | +0.01% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- index-BKGP2w5F.js | 285.56 kB | 0% multipart-parser-DwddZ4BH.js | 9.33 kB | 0% </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-14 22:02: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#21355