[Bug]: Cleanup source resets template goal #2404

Closed
opened 2026-02-28 20:12:57 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @tctree333 on GitHub (Aug 20, 2025).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

When using a #template and #cleanup source tag on a category, running the "End of month cleanup" resets the balance goal to the negative balance of the previous month instead of using the template goal. The docs suggest that you can use #template goals with the cleanup, so I believe this behavior is an issue.

How can we reproduce the issue?

2025-08-19-My Finances.zip

This simplified budget file demonstrates the issue with Actual Client v25.8.0.

  1. Viewing August 2025, pressing "Set budgets to zero" and "Apply budget template" funds the "Savings" category. The balance turns green, indicating that the goal of $2000 is met.
  2. Use "End of month cleanup". The "Savings" balance is still green, but hovering over it shows the goal is now $-5. This also happens if "#cleanup sink" is on the "Savings" category too.
  3. Resetting (Step 1) and then manually changing the budget numbers to the same numbers makes the Savings goal yellow, since the goal of $2000 is not met. This is the expected behavior.

Where are you hosting Actual?

None

What browsers are you seeing the problem on?

Firefox, Chrome

Operating System

Linux

Originally created by @tctree333 on GitHub (Aug 20, 2025). ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? When using a `#template` and `#cleanup source` tag on a category, running the "End of month cleanup" resets the balance goal to the negative balance of the previous month instead of using the template goal. The docs suggest that you can use `#template` goals with the cleanup, so I believe this behavior is an issue. ### How can we reproduce the issue? [2025-08-19-My Finances.zip](https://github.com/user-attachments/files/21881187/2025-08-19-My.Finances.zip) This simplified budget file demonstrates the issue with Actual Client v25.8.0. 1. Viewing August 2025, pressing "Set budgets to zero" and "Apply budget template" funds the "Savings" category. The balance turns green, indicating that the goal of $2000 is met. 2. Use "End of month cleanup". The "Savings" balance is still green, but hovering over it shows the goal is now $-5. This also happens if "#cleanup sink" is on the "Savings" category too. 3. Resetting (Step 1) and then manually changing the budget numbers to the same numbers makes the Savings goal yellow, since the goal of $2000 is not met. This is the expected behavior. ### Where are you hosting Actual? None ### What browsers are you seeing the problem on? Firefox, Chrome ### Operating System Linux
GiteaMirror added the bug label 2026-02-28 20:12:57 -06:00
Author
Owner

@youngcw commented on GitHub (Aug 20, 2025):

Nothing in that process is a bug. I think the confusion comes from what you are expecting the cleanup to do, vs what it actually does.

A cleanup source will remove ALL funds over a balance of 0 and redistribute it. You have a cleanup source in the savings, so all funds will get removed from there. It seems what you are looking for is to cover overspending in the Food category with funds from the Savings category. In that case you would add both the cleanup source and cleanup sink lines to the savings category. So all source funds get pulled into the to budget pot, then any overspending is handled with available to budget funds, then any to budget leftover gets distributed to the sink categories.

@youngcw commented on GitHub (Aug 20, 2025): Nothing in that process is a bug. I think the confusion comes from what you are expecting the cleanup to do, vs what it actually does. A cleanup source will remove ALL funds over a balance of 0 and redistribute it. You have a cleanup source in the savings, so all funds will get removed from there. It seems what you are looking for is to cover overspending in the Food category with funds from the Savings category. In that case you would add both the cleanup source and cleanup sink lines to the savings category. So all source funds get pulled into the to budget pot, then any overspending is handled with available to budget funds, then any to budget leftover gets distributed to the sink categories.
Author
Owner

@tctree333 commented on GitHub (Aug 20, 2025):

Sorry, my description may not have been clear. The issue is with the balance goal, not with the cleanup behavior.

With both source and sink on the Savings category:
Image

Using end of month cleanup:
Image

Manually adjusting overspending:
Image

The budgets and balances are the same in both cases, but the budget goal is different. I would expect the budget goal to be like the second picture when using the End of month cleanup, since it should just be reallocating the funds without affecting the templates.

@tctree333 commented on GitHub (Aug 20, 2025): Sorry, my description may not have been clear. The issue is with the balance goal, not with the cleanup behavior. With both source and sink on the Savings category: <img width="698" height="582.5" alt="Image" src="https://github.com/user-attachments/assets/f1880ba8-0d5e-4173-a9ed-51f0ad232d3c" /> Using end of month cleanup: <img width="698" height="582.5" alt="Image" src="https://github.com/user-attachments/assets/e791d9c6-70a3-4eac-947b-37c77ba3f325" /> Manually adjusting overspending: <img width="698" height="582.5" alt="Image" src="https://github.com/user-attachments/assets/0dd23ac6-d066-41ac-8cd2-99ac65f05ec0" /> The budgets and balances are the same in both cases, but the budget goal is different. I would expect the budget goal to be like the second picture when using the End of month cleanup, since it should just be reallocating the funds without affecting the templates.
Author
Owner

@youngcw commented on GitHub (Aug 20, 2025):

The cleanup source will remove any funds that are considered unused from the category and adjust the goal to not show an unmet goal after the cleanup is run.

@youngcw commented on GitHub (Aug 20, 2025): The cleanup source will remove any funds that are considered unused from the category and adjust the goal to not show an unmet goal after the cleanup is run.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#2404