[GH-ISSUE #2266] [Bug]: Moving transactions between accounts can create transfers with unchangable categories #26681

Closed
opened 2026-04-18 02:56:41 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @kymckay on GitHub (Jan 21, 2024).
Original GitHub issue: https://github.com/actualbudget/actual/issues/2266

Verified issue does not already exist?

  • I have searched and found no existing issue
  • I have checked my server logs and could not see any errors there
  • I will be attaching my server logs to this issue
  • I will be attaching my client-side (browser) logs to this issue
  • I understand that this issue will be automatically closed if insufficient information is provided

What happened?

Reproduction:

  1. Create transactions which are transfers to an off-budget account.
  2. Categorise them.
  3. Move the transactions back to an on-budget account (select them all then use dropdown menu to change account).

Manifestation:

  • Look at the category you set in your budget, you'll see values in the spend column and clicking it will filter to those same transactions even though category is now transfer and can't be changed.

Fix:

  • Category should be cleared when moving transfer transactions from an off-budget to an on-budget account.
  • Data migration should be deployed to clear out categories on existing transfers effected by this.

What error did you receive?

No response

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Firefox

Operating System

Linux

Originally created by @kymckay on GitHub (Jan 21, 2024). Original GitHub issue: https://github.com/actualbudget/actual/issues/2266 ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### Is this related to GoCardless, Simplefin or another bank-sync provider? - [ ] I have checked my server logs and could not see any errors there - [ ] I will be attaching my server logs to this issue - [ ] I will be attaching my client-side (browser) logs to this issue - [ ] I understand that this issue will be automatically closed if insufficient information is provided ### What happened? Reproduction: 1. Create transactions which are transfers to an off-budget account. 2. Categorise them. 3. Move the transactions back to an on-budget account (select them all then use dropdown menu to change account). Manifestation: - Look at the category you set in your budget, you'll see values in the spend column and clicking it will filter to those same transactions even though category is now transfer and can't be changed. Fix: - Category should be cleared when moving transfer transactions from an off-budget to an on-budget account. - Data migration should be deployed to clear out categories on existing transfers effected by this. ### What error did you receive? _No response_ ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Firefox ### Operating System Linux
GiteaMirror added the transactionsgood first issuebug labels 2026-04-18 02:56:41 -05:00
Author
Owner

@shall0pass commented on GitHub (Jan 26, 2024):

I tried to recreate the issue. What am I doing wrong?
Transfer_OffToOn

<!-- gh-comment-id:1912678699 --> @shall0pass commented on GitHub (Jan 26, 2024): I tried to recreate the issue. What am I doing wrong? ![Transfer_OffToOn](https://github.com/actualbudget/actual/assets/20625555/0d239cc1-8eab-45c9-9444-c4eaaedf6200)
Author
Owner

@youngcw commented on GitHub (Jan 26, 2024):

I was able to recreate it. It seems that since a category was set when that was allowed, that app can't tell that the category should not matter any more once the transaction is moved to a different account.

image

<!-- gh-comment-id:1912688795 --> @youngcw commented on GitHub (Jan 26, 2024): I was able to recreate it. It seems that since a category was set when that was allowed, that app can't tell that the category should not matter any more once the transaction is moved to a different account. ![image](https://github.com/actualbudget/actual/assets/28542559/78eae73a-4e76-4305-9ba2-ba27de31628d)
Author
Owner

@youngcw commented on GitHub (Jan 26, 2024):

One option to fix this could be to add an extra check in what counts on budget to not accidentally include transfers. The visuals show that its a transfer, but the search for categories doesn't check that.

That would probably be simpler than a full on migration

<!-- gh-comment-id:1912690736 --> @youngcw commented on GitHub (Jan 26, 2024): One option to fix this could be to add an extra check in what counts on budget to not accidentally include transfers. The visuals show that its a transfer, but the search for categories doesn't check that. That would probably be simpler than a full on migration
Author
Owner

@youngcw commented on GitHub (Jan 26, 2024):

I tried to recreate the issue. What am I doing wrong?

@shall0pass You need to make the transfer originally go to an off budget account, then change the account to an on budget one after the transaction is created

<!-- gh-comment-id:1912692969 --> @youngcw commented on GitHub (Jan 26, 2024): > I tried to recreate the issue. What am I doing wrong? @shall0pass You need to make the transfer originally go to an off budget account, then change the account to an on budget one after the transaction is created
Author
Owner

@shall0pass commented on GitHub (Jan 26, 2024):

I tried to recreate the issue. What am I doing wrong?

@shall0pass You need to make the transfer originally go to an off budget account, then change the account to an on budget one after the transaction is created

Isn't that what I did? The House Asset is off-budget.

<!-- gh-comment-id:1912698921 --> @shall0pass commented on GitHub (Jan 26, 2024): > > I tried to recreate the issue. What am I doing wrong? > > @shall0pass You need to make the transfer originally go to an off budget account, then change the account to an on budget one after the transaction is created Isn't that what I did? The House Asset is off-budget.
Author
Owner

@youngcw commented on GitHub (Jan 26, 2024):

@shall0pass I changed the account via the all acounts page, not the original account holder page. It may be the case that there is already some logic to clean this up that isn't getting called when modifying the account instead of the payee like you did

<!-- gh-comment-id:1912701485 --> @youngcw commented on GitHub (Jan 26, 2024): @shall0pass I changed the account via the all acounts page, not the original account holder page. It may be the case that there is already some logic to clean this up that isn't getting called when modifying the account instead of the payee like you did
Author
Owner

@youngcw commented on GitHub (Jan 29, 2024):

I think that the place to fix the core issue lives in packages/loot-core/src/server/budget/base.ts in one of either/both the handleTransactionChange or createCategory functions.

The createCategory function looks to be what determines the spent cell value and is a long sql query. This could be modified to remove on-budget transfers from the list.
The handTransactionChange function could fix the issue of not unsetting the category, but that may require a db migration to fully fix.

<!-- gh-comment-id:1913807094 --> @youngcw commented on GitHub (Jan 29, 2024): I think that the place to fix the core issue lives in packages/loot-core/src/server/budget/base.ts in one of either/both the handleTransactionChange or createCategory functions. The `createCategory` function looks to be what determines the spent cell value and is a long sql query. This could be modified to remove on-budget transfers from the list. The `handTransactionChange` function could fix the issue of not unsetting the category, but that may require a db migration to fully fix.
Author
Owner

@youngcw commented on GitHub (Jan 29, 2024):

Looks like if you do other changes to the broken transaction, like change the cleared status, or reconcile the account things fix themselves.

I don't know why doing a different modification would unset the category properly, but it didn't happen before.

<!-- gh-comment-id:1913835071 --> @youngcw commented on GitHub (Jan 29, 2024): Looks like if you do other changes to the broken transaction, like change the cleared status, or reconcile the account things fix themselves. I don't know why doing a different modification would unset the category properly, but it didn't happen before.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#26681