-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fix categories being set on offbudget transactions #3705
feat: fix categories being set on offbudget transactions #3705
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
This will be fine for now, but another thing that would be good would be for transactions to get stripped of categories when being added to off budget accounts. People occasionally get categories is their offbudget accounts and it causes issues. |
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged No assets were unchanged |
WalkthroughThe pull request modifies the Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/loot-core/src/mocks/budget.ts (1)
111-116
: LGTM! Consider adding an else clause for clarity.The changes effectively address the issue of adding categories to off-budget transactions. By wrapping the category assignment logic inside the
if (!account.offBudget)
condition, we ensure that categories are only assigned to on-budget accounts.For improved readability, consider adding an explicit
else
clause to handle off-budget accounts:if (!account.offBudget) { if (payee.name === 'Deposit') { category = incomeGroup.categories.find(c => c.name === 'Income'); } else { category = pickRandom(expenseCategories); } +} else { + category = undefined; }This makes it clear that off-budget accounts intentionally have no category assigned.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
upcoming-release-notes/3705.md
is excluded by!**/*.md
📒 Files selected for processing (1)
- packages/loot-core/src/mocks/budget.ts (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/loot-core/src/mocks/budget.ts (2)
137-137
: Good use of optional chaining!The use of optional chaining (
category?.id
) is a good practice here. It prevents potential errors whencategory
is undefined for off-budget accounts, aligning well with the changes made earlier in the function.
Line range hint
111-137
: Verify consistency across other account filling functionsThe changes in
fillPrimaryChecking
effectively address the issue of adding categories to off-budget transactions. However, it's worth verifying if similar changes are needed in other account filling functions (e.g.,fillChecking
,fillSavings
, etc.) to maintain consistency across the codebase.✅ Verification successful
Consistency Verified Across Account Filling Functions
No other account filling functions requiring similar off-budget checks were found. The changes are isolated to
fillPrimaryChecking
, ensuring consistency within the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for other account filling functions that might need similar off-budget checks rg -A 5 "function fill.*\(handlers, account," --glob '!packages/loot-core/src/mocks/budget.ts'Length of output: 96
Script:
#!/bin/bash # Search for other account filling functions that include 'account' as a parameter rg -A 5 "function fill\w*\(.*account.*\)" --glob '!packages/loot-core/src/mocks/budget.ts'Length of output: 92
1f1dee9
to
49fd364
Compare
@youngcw Fixxed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
upcoming-release-notes/3705.md
is excluded by!**/*.md
📒 Files selected for processing (1)
- packages/loot-core/src/server/accounts/transactions.ts (2 hunks)
🧰 Additional context used
sorry for the feature creep, but while we are here can we try to fix #2266? Its pretty similar. |
@youngcw Fixxed it! |
found a bug and I have not been able to recreate this bug on edge
edit: Hah! looks like you also fixed this just now |
I like how you started trying to fix the reports 😄 |
No description provided.