Repository navigation
fix: match "is nothing" rule conditions on transactions without a payee or category - #9017
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hello contributor! We would love to review your PR! Before we can do that, please make sure:
A quick note on volume: please get one PR reviewed and merged before opening several more. A stack of simultaneous, similar PRs from one author is reviewed slowly, and low-effort, untested, or undisclosed-AI PRs may be closed without a detailed review. We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges. For more information, please see our Contributing Guide. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: actualbudget/actual/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesNull transaction rule conditions
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change addresses automatic matching for transactions without a payee or category. No actionable merge-blocking risk is identified; merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Transactions with no payee or category can now trigger additional automatic rules. That includes potentially more than the intended “is nothing” rules, and the resulting changes can be saved during an import. No new access path was identified, but the full effect on rule selection and recovery is not established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
matt-fidd
left a comment
There was a problem hiding this comment.
This makes sense, thanks for the change. I have run it against my rules and I didn't see any behaviour I consider breaking. It's worth remembering this though, just in case users start to see issues with rule application
Description
When a bank sync or file import brings in a transaction without a payee, the normalized transaction has no
payeekey at all:resolvePayeeinsync.tsreturnstrans.payee, which isundefined.Condition.eval()treats a missing field as "never matches", so a rule with the condition "payee is nothing" is skipped for exactly the transactions it is meant for. The same rule does work when applied afterwards from the Rules page, because transactions loaded from the database always carrypayee: null. The same applies tocategory.runRulesnow treats a missingpayee/categoryasnullwhile matching, and drops the field again afterwards if it is stillnull, so the returned transaction keeps the same shape as the input.Conditionitself is unchanged, so no other operators or fields are affected.#7531 took the same approach and was approved in review, but went stale before it was merged.
Related issue(s)
Fixes #5724
Testing
Automated (from the repo root, Windows 11):
yarn workspace @actual-app/core run test:node src/server/transactions/transaction-rules.test.ts src/server/rules/index.test.ts– 147 passed. The two new tests intransaction-rules.test.tsfail without the change totransaction-rules.tsand pass with it.yarn typecheck– all workspaces pass.oxfmt --checkandoxlint --type-awareon the two changed files – clean.yarn test– all workspaces pass locally except two Windows-only environment failures that reproduce identically on master without this change:loot-core/src/server/main.test.tscannot deletemocks/files/budgets/test-budget/db.sqlitebetween tests (EBUSY, thenEEXISTon the nextmkdir), andsync-serverreports all 606 tests passed but exits non-zero withEBUSYdeletingtest-server-files/account.sqlite.testjob across all workspaces, typecheck, lint, the functional and desktop e2e suites and the visual regression shards.To reproduce on master (I verified the behaviour through the unit tests above, not through the UI):
payeeisand the value left empty ("nothing"), and the action setnotestono payee.Checklist
AI disclosure: this change was prepared with AI assistance (Claude Code); follow-up commits and replies on this PR may be as well.
Bundle Stats
View detailed bundle stats
desktop-client
Total
Changeset
locale/zh-Hans.jsonlocale/uk.jsonlocale/en.jsonView detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
Smaller
No assets were smaller
Unchanged
loot-core
Total
Changeset
home/runner/work/actual/actual/packages/loot-core/src/server/transactions/transaction-rules.tsView detailed bundle breakdown
Added
Removed
Bigger
No assets were bigger
Smaller
No assets were smaller
Unchanged
No assets were unchanged
api
Total
Changeset
home/runner/work/actual/actual/packages/loot-core/src/server/transactions/transaction-rules.tsView detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
Smaller
No assets were smaller
Unchanged
cli
Total
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
crdt
Total
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