[GH-ISSUE #5922] [Bug]: Rule to change CLEARED to false is getting run regardless of conditions #44198

Open
opened 2026-04-26 05:12:27 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @natemeyerr-ctrl on GitHub (Oct 14, 2025).
Original GitHub issue: https://github.com/actualbudget/actual/issues/5922

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

I created a rule to set the CLEARED flag to false on all imported transactions. The IF is amount < $10,000 (this is just a way to catch all rows), and the THEN is set cleared to false.

It works! The imported rows now import as uncleared.

However, everytime the rule runs, it marks all other previously imported transactions as uncleared. So now all my transactions on my chequing account are uncleared.

I also added another THEN to the rule just to see what rows it's actually meaning to update. I added THEN prepend to notes = TEST.

Imported, and the newly imported rows is uncleared, and it has TEST in the notes line.

However, all other rows in that account are now also uncleared, but there is no TEST in those rows.

So whenever you use cleared equals false in a rule it seems to clear all transactions in the account instead of just the imported transactions

How can we reproduce the issue?

  1. Marked all rows in checking as cleared
  2. Create a rule to catch all imported transactions (ex: amount < 10000, then cleared = false
  3. Import, and notice the newly imported rows are marked as uncleared, but now ALL other rows in the account are also uncleared.

Where are you hosting Actual?

Pikapods

What browsers are you seeing the problem on?

Chrome

Operating System

Windows 11

Originally created by @natemeyerr-ctrl on GitHub (Oct 14, 2025). Original GitHub issue: https://github.com/actualbudget/actual/issues/5922 ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? I created a rule to set the CLEARED flag to false on all imported transactions. The IF is amount < $10,000 (this is just a way to catch all rows), and the THEN is set cleared to false. It works! The imported rows now import as uncleared. However, everytime the rule runs, it marks all other previously imported transactions as uncleared. So now all my transactions on my chequing account are uncleared. I also added another THEN to the rule just to see what rows it's actually meaning to update. I added THEN prepend to notes = TEST. Imported, and the newly imported rows is uncleared, and it has TEST in the notes line. However, all other rows in that account are now also uncleared, but there is no TEST in those rows. So whenever you use cleared equals false in a rule it seems to clear all transactions in the account instead of just the imported transactions ### How can we reproduce the issue? 1) Marked all rows in checking as cleared 2) Create a rule to catch all imported transactions (ex: amount < 10000, then cleared = false 3) Import, and notice the newly imported rows are marked as uncleared, but now ALL other rows in the account are also uncleared. ### Where are you hosting Actual? Pikapods ### What browsers are you seeing the problem on? Chrome ### Operating System Windows 11
GiteaMirror added the ruleshelp wantedbug labels 2026-04-26 05:12:28 -05:00
Author
Owner

@youngcw commented on GitHub (Oct 14, 2025):

Are you using bank sync? My guess is that the problem is that the other transactions are getting imported and merged and thus rules are running on those transactions. Bank sync will import up to 90 days of transactions every sync, so your rule is being run on 90 days worth of transactions every time you sync.

I was not able to recreate this when using an ofx file as only a few of the transactions were getting "hit" by the import and only the new/modified transactions get the rule run.

<!-- gh-comment-id:3399830076 --> @youngcw commented on GitHub (Oct 14, 2025): Are you using bank sync? My guess is that the problem is that the other transactions are getting imported and merged and thus rules are running on those transactions. Bank sync will import up to 90 days of transactions every sync, so your rule is being run on 90 days worth of transactions every time you sync. I was not able to recreate this when using an ofx file as only a few of the transactions were getting "hit" by the import and only the new/modified transactions get the rule run.
Author
Owner

@natemeyerr-ctrl commented on GitHub (Oct 14, 2025):

Yes. I'm using bank sync. What your saying makes sense.

The rule also adds the word test in front of the notes. Do you have an explanation on why the merged records don't receive the test but do receive the unclear flag?

<!-- gh-comment-id:3399984105 --> @natemeyerr-ctrl commented on GitHub (Oct 14, 2025): Yes. I'm using bank sync. What your saying makes sense. The rule also adds the word test in front of the notes. Do you have an explanation on why the merged records don't receive the test but do receive the unclear flag?
Author
Owner

@youngcw commented on GitHub (Oct 14, 2025):

Im only seeing the rule get applied to transactions that were part of the import. So no "test" and no unclearing of transactions that weren't imported or touched by the import.

<!-- gh-comment-id:3401987476 --> @youngcw commented on GitHub (Oct 14, 2025): Im only seeing the rule get applied to transactions that were part of the import. So no "test" and no unclearing of transactions that weren't imported or touched by the import.
Author
Owner

@youngcw commented on GitHub (Oct 14, 2025):

If you want this rule to only apply to new transactions you will need to make your rule more complicated. For example, exclude transactions that have notes with "#Approved" in the un clear rule, then a separate rule that adds the "#Approved" tag to the notes at some point.

<!-- gh-comment-id:3401994538 --> @youngcw commented on GitHub (Oct 14, 2025): If you want this rule to only apply to new transactions you will need to make your rule more complicated. For example, exclude transactions that have notes with "#Approved" in the un clear rule, then a separate rule that adds the "#Approved" tag to the notes at some point.
Author
Owner

@natemeyerr-ctrl commented on GitHub (Oct 14, 2025):

Gotcha! I made the rule more complicated

  1. First, I manually added #Imported to ALL previous transactions
  2. Created a PRE rule. If NOTES does not contain #Imported, then SET CLEARED to false.
Image
  1. Created a POST rule. If NOTES does not contain #Imported, then PREPEND TO NOTES #Imported.
Image
  1. I go into my account, and make sure ALL transactions are CLEARED, and ALL transactions have #Imported at the beginning.
Image
  1. I then delete the Youtube Premium transaction (to simulate having a new transaction). The only other transaction is U-Haul, which has #Imported in the Notes, and it's CLEARED
Image
  1. I run Bank Sync

  2. That new transaction (Youtube Premium) is imported and has #Imported in the NOTES. The cleared flag is also uncleared. However, the U-Haul transaction is also now UNCLEARED. even though it had #Imported in the notes.

Image

I'm not sure what I'm missing here. But it seems there's a bug with the cleared flag, triggering on all transactions regardless of the criteria.

<!-- gh-comment-id:3402110394 --> @natemeyerr-ctrl commented on GitHub (Oct 14, 2025): Gotcha! I made the rule more complicated 1) First, I manually added #Imported to ALL previous transactions 2) Created a PRE rule. If NOTES does not contain #Imported, then SET CLEARED to false. <img width="888" height="271" alt="Image" src="https://github.com/user-attachments/assets/bd939f73-3e7f-47a0-98b1-684607b58836" /> 3) Created a POST rule. If NOTES does not contain #Imported, then PREPEND TO NOTES #Imported. <img width="895" height="276" alt="Image" src="https://github.com/user-attachments/assets/029096b9-3fd2-4c16-9bd4-66f46f5bac6a" /> 4) I go into my account, and make sure ALL transactions are CLEARED, and ALL transactions have #Imported at the beginning. <img width="1657" height="107" alt="Image" src="https://github.com/user-attachments/assets/ecf54add-c2f3-4a88-9c18-92ae31f434b6" /> 5) I then delete the Youtube Premium transaction (to simulate having a new transaction). The only other transaction is U-Haul, which has #Imported in the Notes, and it's CLEARED <img width="1661" height="63" alt="Image" src="https://github.com/user-attachments/assets/fee91f43-4602-4703-8fb8-800ae054b75f" /> 6) I run Bank Sync 7) That new transaction (Youtube Premium) is imported and has #Imported in the NOTES. The cleared flag is also uncleared. However, the U-Haul transaction is also now UNCLEARED. even though it had #Imported in the notes. <img width="1656" height="95" alt="Image" src="https://github.com/user-attachments/assets/dfa7fa4d-c9bf-44bb-bc5a-0760af0bc0c5" /> I'm not sure what I'm missing here. But it seems there's a bug with the cleared flag, triggering on all transactions regardless of the criteria.
Author
Owner

@youngcw commented on GitHub (Oct 14, 2025):

Ok, I am able to recreate it with these steps. I don't know whats happening, but the rule is getting applied to transactions it shouldn't. The rule edit page doesn't include the transactions marked as #IMPORTED but the rules are getting applied anyway.

I recreated it with both bank sync and OFX import so its probably an issue in the rules code directly.

<!-- gh-comment-id:3402248196 --> @youngcw commented on GitHub (Oct 14, 2025): Ok, I am able to recreate it with these steps. I don't know whats happening, but the rule is getting applied to transactions it shouldn't. The rule edit page doesn't include the transactions marked as #IMPORTED but the rules are getting applied anyway. I recreated it with both bank sync and OFX import so its probably an issue in the rules code directly.
Author
Owner

@natemeyerr-ctrl commented on GitHub (Oct 15, 2025):

Thanks!

<!-- gh-comment-id:3404097235 --> @natemeyerr-ctrl commented on GitHub (Oct 15, 2025): Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#44198