Skip to content

[React Query] New queries and mutations for rules - #7070

Closed
joel-jeremy wants to merge 11 commits into
masterfrom
react-query-rules
Closed

joel-jeremy wants to merge 11 commits into
masterfrom
react-query-rules

Conversation

@joel-jeremy

@joel-jeremy joel-jeremy commented Feb 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Related issue(s)

Testing

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 26 12.42 MB → 12 MB (-429.56 kB) -3.38%
loot-core 1 4.83 MB → 4.83 MB (+166 B) +0.00%
api 4 4.06 MB → 4.06 MB (+160 B) +0.00%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
26 12.42 MB → 12 MB (-429.56 kB) -3.38%
Changeset
File Δ Size
src/rules/mutations.ts 🆕 +7.1 kB 0 B → 7.1 kB
src/rules/queries.ts 🆕 +585 B 0 B → 585 B
src/hooks/useRules.ts 🆕 +146 B 0 B → 146 B
src/hooks/usePayeeRules.ts 🆕 +144 B 0 B → 144 B
src/components/rules/Value.tsx 📈 +4.41 kB (+103.62%) 4.26 kB → 8.67 kB
src/components/mobile/rules/MobileRulesPage.tsx 📈 +2.46 kB (+59.94%) 4.11 kB → 6.57 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/rules.ts 📈 +947 B (+12.91%) 7.17 kB → 8.09 kB
src/components/ManageRules.tsx 📈 +1.05 kB (+7.64%) 13.72 kB → 14.77 kB
src/components/rules/ScheduleValue.tsx 📈 +118 B (+6.27%) 1.84 kB → 1.95 kB
src/hooks/usePreviewTransactions.ts 📈 +76 B (+3.35%) 2.21 kB → 2.29 kB
src/components/modals/MergeUnusedPayeesModal.tsx 📈 +149 B (+1.99%) 7.31 kB → 7.45 kB
src/components/accounts/Account.tsx 📈 +363 B (+0.81%) 43.79 kB → 44.14 kB
src/components/mobile/transactions/TransactionEdit.tsx 📈 +348 B (+0.58%) 58.28 kB → 58.62 kB
node_modules/react-dnd/dist/hooks/useDrop/useDrop.js 📈 +2 B (+0.48%) 413 B → 415 B
src/budget/mutations.ts 📈 +40 B (+0.32%) 12.36 kB → 12.4 kB
node_modules/react-dnd/dist/hooks/useDrag/useDrag.js 📈 +2 B (+0.30%) 661 B → 663 B
src/components/sort.tsx 📈 +10 B (+0.22%) 4.43 kB → 4.44 kB
src/components/transactions/TransactionMenu.tsx 📈 +18 B (+0.21%) 8.29 kB → 8.3 kB
src/components/filters/FiltersMenu.tsx 📈 +28 B (+0.17%) 16.46 kB → 16.49 kB
src/components/rules/RuleEditor.tsx 📈 +37 B (+0.08%) 44.87 kB → 44.91 kB
src/components/budget/ExpenseGroup.tsx 📈 +4 B (+0.08%) 4.93 kB → 4.93 kB
src/components/budget/IncomeCategory.tsx 📈 +2 B (+0.06%) 3.02 kB → 3.03 kB
src/components/transactions/TransactionsTable.tsx 📈 +50 B (+0.06%) 85.09 kB → 85.14 kB
src/components/budget/ExpenseCategory.tsx 📈 +2 B (+0.05%) 3.68 kB → 3.69 kB
src/components/mobile/accounts/AccountTransactions.tsx 📈 +2 B (+0.02%) 8.4 kB → 8.4 kB
src/components/CommandBar.tsx 📈 +2 B (+0.02%) 9.91 kB → 9.91 kB
src/components/budget/BudgetCategories.tsx 📈 +2 B (+0.02%) 11.81 kB → 11.81 kB
src/components/sidebar/Account.tsx 📈 +2 B (+0.02%) 11.96 kB → 11.96 kB
src/components/payees/ManagePayees.tsx 📈 +2 B (+0.01%) 14.74 kB → 14.74 kB
src/components/autocomplete/CategoryAutocomplete.tsx 📈 +2 B (+0.01%) 15.36 kB → 15.36 kB
src/components/transactions/SelectedTransactionsButton.tsx 📈 +2 B (+0.01%) 16.79 kB → 16.79 kB
src/rules/index.ts +0 B (0%) 0 B → 0 B
src/components/table.tsx 📉 -2 B (-0.01%) 37.63 kB → 37.62 kB
src/components/autocomplete/AccountAutocomplete.tsx 📉 -2 B (-0.02%) 10.49 kB → 10.49 kB
src/components/mobile/MobileNavTabs.tsx 📉 -2 B (-0.02%) 10.04 kB → 10.04 kB
src/components/PrivacyFilter.tsx 📉 -2 B (-0.03%) 5.71 kB → 5.71 kB
src/components/budget/envelope/CoverMenu.tsx 📉 -2 B (-0.04%) 4.71 kB → 4.71 kB
src/components/budget/envelope/TransferMenu.tsx 📉 -2 B (-0.04%) 4.46 kB → 4.46 kB
src/hooks/useSelected.tsx 📉 -6 B (-0.07%) 8.15 kB → 8.15 kB
src/hooks/useDisplayPayee.tsx 📉 -8 B (-0.17%) 4.72 kB → 4.71 kB
src/components/transactions/table/utils.ts 📉 -4 B (-0.22%) 1.78 kB → 1.78 kB
node_modules/@use-gesture/react/dist/use-gesture-react.esm.js 📉 -2 B (-0.31%) 644 B → 642 B
src/components/schedules/DiscoverSchedules.tsx 📉 -28 B (-0.31%) 8.8 kB → 8.77 kB
src/components/mobile/rules/MobileRuleEditPage.tsx 📉 -169 B (-4.80%) 3.44 kB → 3.27 kB
src/components/transactions/TransactionList.tsx 📉 -1.49 kB (-8.69%) 17.15 kB → 15.66 kB
src/components/modals/ManageRulesModal.tsx 📉 -218 B (-21.44%) 1017 B → 799 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.22 MB → 3.34 MB (+122.95 kB) +3.73%
static/js/narrow.js 353.47 kB → 355.77 kB (+2.3 kB) +0.65%

Smaller

Asset File Size % Changed
static/js/theme.js 476.35 kB → 30.68 kB (-445.67 kB) -93.56%
static/js/useTransactionBatchActions.js 4.29 MB → 4.18 MB (-109.15 kB) -2.49%

Unchanged

Asset File Size % Changed
static/js/BackgroundImage.js 119.98 kB 0%
static/js/FormulaEditor.js 846.44 kB 0%
static/js/ReportRouter.js 1021.25 kB 0%
static/js/TransactionList.js 81.29 kB 0%
static/js/ca.js 185.62 kB 0%
static/js/da.js 104.66 kB 0%
static/js/de.js 177.63 kB 0%
static/js/en-GB.js 7.16 kB 0%
static/js/en.js 169.27 kB 0%
static/js/es.js 172.13 kB 0%
static/js/fr.js 177.63 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 168.97 kB 0%
static/js/nb-NO.js 154.72 kB 0%
static/js/nl.js 111.58 kB 0%
static/js/pl.js 88.34 kB 0%
static/js/pt-BR.js 180.55 kB 0%
static/js/resize-observer.js 18.03 kB 0%
static/js/th.js 179.94 kB 0%
static/js/uk.js 213.14 kB 0%
static/js/wide.js 418 B 0%
static/js/workbox-window.prod.es5.js 7.28 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 4.83 MB → 4.83 MB (+166 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/rules/app.ts 📈 +277 B (+9.31%) 2.9 kB → 3.17 kB
home/runner/work/actual/actual/packages/loot-core/src/server/schedules/app.ts 📉 -37 B (-0.31%) 11.84 kB → 11.81 kB
home/runner/work/actual/actual/packages/loot-core/src/server/api.ts 📉 -74 B (-0.32%) 22.53 kB → 22.46 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.D1WYsJ8A.js 0 B → 4.83 MB (+4.83 MB) -

Removed

Asset File Size % Changed
kcab.worker.Dmj0rSrb.js 4.83 MB → 0 B (-4.83 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
4 4.06 MB → 4.06 MB (+160 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/rules/app.ts 📈 +275 B (+9.42%) 2.85 kB → 3.12 kB
home/runner/work/actual/actual/packages/loot-core/src/server/schedules/app.ts 📉 -37 B (-0.31%) 11.63 kB → 11.6 kB
home/runner/work/actual/actual/packages/loot-core/src/server/api.ts 📉 -78 B (-0.35%) 21.96 kB → 21.88 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.84 MB → 3.84 MB (+160 B) +0.00%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
from-Bl-Hslp4.js 167.73 kB 0%
multipart-parser-BnDysoMr.js 8.1 kB 0%
src-iMkUmuwR.js 43.64 kB 0%

@actual-github-bot actual-github-bot Bot changed the title [react-query [WIP] [react-query Feb 24, 2026
@netlify

netlify Bot commented Feb 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 4fae08e
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/69bad4a113371e0007a9c5f0
😎 Deploy Preview https://deploy-preview-7070.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@joel-jeremy joel-jeremy changed the title [WIP] [react-query [React Query] New queries and mutations for rules Feb 24, 2026
@coderabbitai

coderabbitai Bot commented Feb 24, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Replaces IPC-driven rule operations with React Query hooks and mutations, centralizes rule queries/mutations (list, payee-list, CRUD, run, apply, batch), updates UI to consume hook-driven loading/refetch flows, tightens server signatures (throwing errors) and adjusts several component prop/type signatures.

Changes

Cohort / File(s) Summary
Rules infra (client)
packages/desktop-client/src/rules/index.ts, packages/desktop-client/src/rules/queries.ts, packages/desktop-client/src/rules/mutations.ts
Adds centralized rule queries and React Query mutations (list, payee-list, CRUD, batch delete, apply-actions, run-rules, payee-rename, create-single-time-schedule) with cache invalidation and standardized error/notification handling.
Rules hooks
packages/desktop-client/src/hooks/useRules.ts, packages/desktop-client/src/hooks/usePayeeRules.ts
New hooks exposing rule lists, loading, and refetch to replace previous IPC/load-state patterns.
Manage rules UI
packages/desktop-client/src/components/ManageRules.tsx, packages/desktop-client/src/components/modals/ManageRulesModal.tsx
Removes local loading/setLoading prop, uses useRules/usePayeeRules and delete mutations; adds centralized loading UI and disables Delete when schedule-linked rules selected.
Rule editor & parsing
packages/desktop-client/src/components/rules/RuleEditor.tsx, packages/loot-core/src/shared/rules.ts
Introduces typed parseConditions/unparseConditions and parseActions/unparseActions; routes save/apply through mutations and maps mutation errors to field-level errors.
Value & schedule display
packages/desktop-client/src/components/rules/Value.tsx, packages/desktop-client/src/components/rules/ScheduleValue.tsx
Removes data prop from Value; ScheduleValue now accepts schedule id and looks up/deals with deleted schedules.
Filters menu
packages/desktop-client/src/components/filters/FiltersMenu.tsx
Replaced unparse with unparseConditions and guards GenericInput rendering on truthy type.
Mobile rules pages
packages/desktop-client/src/components/mobile/rules/MobileRuleEditPage.tsx, packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
Switches to useRules for loading and delete mutations; removes local loading and dispatch-based error paths; uses refetch on undo and mutation on delete.
Account & transactions
packages/desktop-client/src/components/accounts/Account.tsx, packages/desktop-client/src/components/transactions/TransactionList.tsx, packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
Introduces useRunRulesMutation and useCreateSingleTimeScheduleFromTransaction hooks; replaces IPC/inline schedule creation with mutation-based APIs and wires onRunRules through components.
Preview & hooks
packages/desktop-client/src/hooks/usePreviewTransactions.ts
Replaces direct rules-run RPC with run-rules mutation while preserving mapping and running-balance logic.
Merge / payee flows
packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
Uses useAddPayeeRenameRuleMutation instead of RPC for creating payee-rename rules.
Server: rules & schedules
packages/loot-core/src/server/rules/app.ts, packages/loot-core/src/server/schedules/app.ts, packages/loot-core/src/server/api.ts
Handlers now throw on errors (instead of returning error objects); exposes rules-run mutator; createSchedule always generates a new id and enforces date condition; signatures tightened to use RuleConditionEntity and PayeeEntity types.
Types
packages/loot-core/src/types/models/rule.ts, packages/loot-core/src/server/transactions/transaction-rules.ts
Changes LinkScheduleRuleActionEntity.value to ScheduleEntity['id']; tightens payee-rename parameter types to use PayeeEntity-based types.
Misc UI & pages
packages/desktop-client/src/components/rules/*, packages/desktop-client/src/components/mobile/*, packages/desktop-client/src/components/schedules/*
Various components updated to consume new hooks/mutations, adjust props (removed setLoading, added createSingleTimeScheduleFromTransaction/runRules hooks), and update memo/deps and loading paths.
Docs
upcoming-release-notes/7070.md
Adds release-note stub describing React Query hooks and mutation-driven rules management.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant UI as "Client UI"
    participant Hooks as "Rules Hooks / Mutations"
    participant Server as "Backend (mutators / RPC)"
    participant Cache as "React Query Cache"
    UI->>Hooks: call mutateAsync({ transaction / payload })
    Hooks->>Server: RPC / mutator call (e.g., rules-run, create-schedule, add-rule)
    Server-->>Hooks: result or throw error
    Hooks->>Cache: invalidate relevant queries (rules lists)
    Cache-->>UI: refetch / updated data via useQuery
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐰 I hopped from IPC to Query’s song,
Mutations marching, steady and strong.
Conditions typed and schedules lean,
Rules now run through a polished machine.
A joyful rabbit celebrates this merge — hooray! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is mostly a template with unchecked checklist items and no substantive explanation of the changes, making it vague and generic. Provide a meaningful description of what the PR does, why it's needed, and what problems it solves. Include testing details and ensure the release notes checklist is addressed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: introducing React Query hooks and mutations for rules management.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch react-query-rules
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
packages/desktop-client/src/components/accounts/Account.tsx (1)

712-739: ⚠️ Potential issue | 🟡 Minor

User-facing error messages are not translated.

Two notification messages — the formula error summary (Line 714) and the generic failure message (Line 737) — are raw string literals not wrapped with t(). As per the i18n guidelines, all user-facing strings must be translated.

🌐 Proposed fix
-              message: `Formula errors in rules:\n${allErrors.join('\n')}`,
+              message: t('Formula errors in rules:\n{{errors}}', { errors: allErrors.join('\n') }),
-              message: 'Failed to apply rules to transactions',
+              message: t('Failed to apply rules to transactions'),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/accounts/Account.tsx` around lines 712
- 739, The two user-facing notification strings must be localized: wrap the
formula error summary and the generic failure message with the i18n t() function
(ensure t is imported where Account.tsx defines methods like the try/catch
around apply rules); for the formula error use a translation key with a
placeholder and pass errors: allErrors.join('\n') (i.e., message:
t('accounts.formulaErrors', { errors: allErrors.join('\n') }) or similar) and
replace the hardcoded 'Failed to apply rules to transactions' with
t('accounts.applyRulesFailed'); keep the notifications created via
addNotification unchanged except for replacing message values, and ensure any
newline formatting is preserved via the placeholder.
packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx (1)

64-83: ⚠️ Potential issue | 🟡 Minor

Add the new mutation to the useCallback deps.

onMerge now closes over addPayeeRenameRuleAsync but it isn’t listed in the dependency array, which risks stale closures and hooks lint warnings.

🔧 Suggested change
-    [shouldCreateRule, isEditingRule, payees],
+    [shouldCreateRule, isEditingRule, payees, addPayeeRenameRuleAsync],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx`
around lines 64 - 83, The onMerge useCallback closes over
addPayeeRenameRuleAsync (and also uses send) but the dependency array only lists
shouldCreateRule, isEditingRule, and payees; update the dependency array for the
onMerge callback (the one declared with useCallback in
MergeUnusedPayeesModal.tsx) to include addPayeeRenameRuleAsync (and send if it
comes from props/hooks) so the hook doesn't capture a stale closure and
satisfies lint rules.
packages/desktop-client/src/hooks/usePreviewTransactions.ts (2)

76-143: ⚠️ Potential issue | 🟡 Minor

Add runRulesAsync to the effect dependencies.

The effect closes over runRulesAsync, but it isn’t listed, which can produce stale closures and hooks lint warnings.

🔧 Suggested change
-  }, [scheduleTransactions, schedules, statuses, upcomingLength]);
+  }, [runRulesAsync, scheduleTransactions, schedules, statuses, upcomingLength]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/hooks/usePreviewTransactions.ts` around lines 76
- 143, The useEffect in the usePreviewTransactions hook closes over
runRulesAsync (from useRunRulesMutation) but the dependency array only lists
scheduleTransactions, schedules, statuses, and upcomingLength; update the
effect's dependency array to include runRulesAsync so the effect re-runs when
the mutation function changes and to satisfy the hooks lint rule; locate the
useEffect block inside usePreviewTransactions and add runRulesAsync to the array
of dependencies.

76-95: ⚠️ Potential issue | 🟠 Major

Avoid user-facing side effects during preview generation.

useRunRulesMutation invalidates rule queries and dispatches error notifications. Running it for every preview transaction can spam invalidations and surface errors for background previews. Consider using a lightweight helper (e.g., direct send('rules-run')) or adding a “silent”/“no-invalidate” option to the mutation for this path.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/hooks/usePreviewTransactions.ts` around lines 76
- 95, The preview hook usePreviewTransactions currently calls runRulesAsync
(from useRunRulesMutation) for each scheduleTransactions which triggers query
invalidations and error notifications; change this to a non-user-facing path by
either (1) invoking a lightweight helper that dispatches the rule engine without
side effects (e.g., call send('rules-run') / applyRulesSilently) from inside
usePreviewTransactions, or (2) extend useRunRulesMutation to accept a silent
option (e.g., { silent: true } or { noInvalidate: true }) and pass that option
when calling runRulesAsync so it applies rules for previews without invalidating
queries or emitting notifications; update the call sites in
usePreviewTransactions (where runRulesAsync is used) to use the new silent
helper/option and ensure the mutation implementation checks that flag and skips
invalidation/notification logic.
packages/desktop-client/src/components/filters/FiltersMenu.tsx (1)

26-32: ⚠️ Potential issue | 🔴 Critical

unparse is now undefined—replace with unparseConditions at line 619.

The import was switched to unparseConditions, but the code at line 619 still calls the undefined unparse function, causing a compilation error.

Fix
-        // `@ts-expect-error` - fix me
-        cond = unparse({ ...cond, type: FIELD_TYPES.get(cond.field) });
+        // `@ts-expect-error` - fix me
+        cond = unparseConditions({ ...cond, type: FIELD_TYPES.get(cond.field) });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/filters/FiltersMenu.tsx` around lines
26 - 32, The code still calls the removed function unparse (causing a compile
error) — replace that call with unparseConditions so the imported symbol is
used; update the invocation at the FiltersMenu component where unparse(...) is
called to unparseConditions(...) with the same arguments, ensuring you remove
any lingering references to unparse and rely on the already-imported
unparseConditions.
packages/desktop-client/src/components/rules/RuleEditor.tsx (1)

1008-1062: ⚠️ Potential issue | 🟠 Major

Use optional chaining for splitIndex extraction and remove the type assertion in actionSplits init.

The pattern 'options' in action && 'splitIndex' in action.options can throw a TypeError if options is explicitly undefined. Most action types in the RuleActionEntity union have options as optional, making them vulnerable. Additionally, the as (typeof actionSplits)[0] type assertion violates the coding guideline to avoid assertions.

✅ Suggested fix
-    const parsedActions = defaultRule.actions.map(parseActions);
+    const parsedActions = defaultRule.actions.map(parseActions);
+    const initialSplits: Array<{
+      id: string;
+      actions: Array<RuleActionEntity & { inputKey: string }>;
+    }> = [{ id: uuid(), actions: [] }];
     return parsedActions.reduce(
       (acc, action) => {
-        const splitIndex =
-          'options' in action && 'splitIndex' in action.options
-            ? (action.options.splitIndex ?? 0)
-            : 0;
+        const splitIndex = action.options?.splitIndex ?? 0;
         acc[splitIndex] = acc[splitIndex] ?? { id: uuid(), actions: [] };
         acc[splitIndex].actions.push({ ...action, inputKey: uuid() });
         return acc;
       },
       // The pre-split group is always there
-      [{ id: uuid(), actions: [] } as (typeof actionSplits)[0]],
+      initialSplits,
     );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx` around lines
1008 - 1062, The splitIndex extraction in the actionSplits initializer can throw
if action.options is undefined and the initial accumulator uses a type
assertion; update the reducer in the actionSplits useState (the block that calls
parseActions on defaultRule.actions and reduces into actionSplits) to use
optional chaining when reading splitIndex (e.g., action.options?.splitIndex ??
0) and remove the "as (typeof actionSplits)[0]" assertion by constructing the
initial accumulator with an explicitly shaped object that matches the
actionSplits element type (id: uuid(), actions: []) or by casting the whole
useState generic instead of asserting the initial value.
packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx (2)

677-792: ⚠️ Potential issue | 🟡 Minor

Add createSingleTimeScheduleFromTransaction to the onSaveInner dependency array.

The mutation function is directly used within the callback at line 730 (await createSingleTimeScheduleFromTransaction(...)). It must be included in the dependency array to satisfy the react-hooks/exhaustive-deps ESLint rule.

Suggested fix
-    }, [
-      isAdding,
-      dispatch,
-      navigate,
-      onSave,
-      unserializedTransactions,
-      upcomingLength,
-      t,
-    ]);
+    }, [
+      isAdding,
+      dispatch,
+      navigate,
+      onSave,
+      unserializedTransactions,
+      upcomingLength,
+      t,
+      createSingleTimeScheduleFromTransaction,
+    ]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx`
around lines 677 - 792, The onSaveInner callback uses the mutation function
createSingleTimeScheduleFromTransaction but doesn't list it in its dependency
array, violating react-hooks/exhaustive-deps; update the dependency array for
onSaveInner (the useCallback that defines onSaveInner) to include
createSingleTimeScheduleFromTransaction so the hook re-evaluates when that
mutation function changes.

1421-1479: ⚠️ Potential issue | 🟡 Minor

Add runRulesAsync to the onUpdate dependency array.

The callback uses runRulesAsync but doesn't include it in the dependency array. Since useMutation is not listed in the codebase's ESLint exhaustive-deps additionalHooks config, all used variables must be explicitly included in dependencies.

Suggested fix
-    [dateFormat, transactions],
+    [dateFormat, transactions, runRulesAsync],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx`
around lines 1421 - 1479, The onUpdate callback (defined with useCallback)
references runRulesAsync from useRunRulesMutation but runRulesAsync is missing
from its dependency array; update the dependency array for onUpdate to include
runRulesAsync (in addition to dateFormat and transactions) so the callback
updates correctly when the mutation function changes.
🧹 Nitpick comments (9)
packages/loot-core/src/server/rules/app.ts (2)

126-134: return isSuccess at Line 133 is always true and is misleading.

After the if (!isSuccess) throw ... guard, isSuccess is always true. The explicit return isSuccess is confusing — replace with return true (or return isSuccess is fine logically, but the intent is unclear).

♻️ Proposed fix
 async function deleteRule(id: RuleEntity['id']) {
   const isSuccess = await rules.deleteRule(id);
   if (!isSuccess) {
     throw new Error(
       'Error deleting rule. The rule may be linked to a schedule which prevents it from being deleted.',
     );
   }
-  return isSuccess;
+  return true;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/loot-core/src/server/rules/app.ts` around lines 126 - 134, The
return of isSuccess in deleteRule is misleading because after the guard `if
(!isSuccess) throw ...` the variable can only be true; update the function to
make intent clear by returning a literal true instead of `isSuccess` (or
alternatively remove the variable and directly `await rules.deleteRule(id)` then
return true); locate the deleteRule function and the `isSuccess` assignment from
`rules.deleteRule(id)` and change the final `return isSuccess;` to `return
true;` (or simplify by omitting `isSuccess` and returning true after the throw
guard).

106-123: Throwing a plain ValidationError object loses stack trace information.

Both addRule and updateRule throw error where error is a plain object { conditionErrors, actionErrors } (not an Error instance). Plain-object throws have no stack trace, and instanceof Error guards in catch-blocks won't match them. The ValidationError type already exists (Lines 67–70); wrapping it in a proper Error subclass would make error handling more robust and debuggable.

♻️ Suggested improvement
+class RuleValidationError extends Error {
+  conditionErrors: string[];
+  actionErrors: string[];
+  constructor({ conditionErrors, actionErrors }: ValidationError) {
+    super('Rule validation failed');
+    this.conditionErrors = conditionErrors;
+    this.actionErrors = actionErrors;
+  }
+}

 async function addRule(rule: Omit<RuleEntity, 'id'>): Promise<RuleEntity> {
   const error = validateRule(rule);
   if (error) {
-    throw error;
+    throw new RuleValidationError(error);
   }
   ...
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/loot-core/src/server/rules/app.ts` around lines 106 - 123, The
validateRule call presently returns a plain object which is thrown (in addRule
and updateRule), losing stack and Error semantics; change this by creating/using
a real Error subclass (e.g., class ValidationError extends Error that accepts
conditionErrors and actionErrors and sets them as properties, capturing the
stack) and replace the raw throws in addRule and updateRule with throwing a new
instance (e.g., throw new ValidationError(conditionErrors, actionErrors));
ensure the ValidationError constructor sets name, message, the two error arrays,
and captures stack (via Error.captureStackTrace or super()) so downstream
instanceof Error checks and stack traces work.
packages/desktop-client/src/hooks/useRules.ts (1)

8-8: Consider exporting UseRulesOptions for external consumers.

UseRulesOptions is not exported. Any component that wants to type the options argument of useRules (e.g., in a useMemo or when forwarding props) must inline Pick<UseQueryOptions<RuleEntity[]>, 'enabled'> or use Parameters<typeof useRules>[0]. Exporting the type is a minor ergonomics improvement.

♻️ Proposed change
-type UseRulesOptions = Pick<UseQueryOptions<RuleEntity[]>, 'enabled'>;
+export type UseRulesOptions = Pick<UseQueryOptions<RuleEntity[]>, 'enabled'>;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/hooks/useRules.ts` at line 8, UseRulesOptions is
currently unexported which forces callers to inline its definition; export the
type so external consumers can reference it. Update the declaration of
UseRulesOptions to be exported (export type UseRulesOptions =
Pick<UseQueryOptions<RuleEntity[]>, 'enabled'>) and ensure the module's public
exports include it alongside useRules so callers can import UseRulesOptions
directly.
packages/desktop-client/src/components/accounts/Account.tsx (1)

1059-1062: Promise.all on rules execution is unnecessary for a single reconciliation transaction.

realizeTempTransactions always produces exactly one reconciliation transaction, so Promise.all adds no parallelism benefit. More importantly, runRules → finalizeTransactionForRules can insert new payees; running multiple transactions concurrently could cause duplicate payee inserts (a known hazard in this codebase). A sequential loop is safer and equally performant here.

♻️ Proposed refactor
-    const runRules = this.props.onRunRules;
-    const ruledTransactions = await Promise.all(
-      reconciliationTransactions.map(transaction => runRules(transaction)),
-    );
+    const ruledTransactions: TransactionEntity[] = [];
+    for (const transaction of reconciliationTransactions) {
+      ruledTransactions.push(await this.props.onRunRules(transaction));
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/accounts/Account.tsx` around lines
1059 - 1062, realizeTempTransactions always returns exactly one reconciliation
transaction, so calling Promise.all on reconciliationTransactions with runRules
risks concurrent inserts (runRules → finalizeTransactionForRules) and is
unnecessary; replace the Promise.all call in Account.tsx with a sequential await
loop (e.g., for/for-of) that calls this.props.onRunRules (runRules) for each
transaction to ensure runs execute one-by-one and avoid duplicate payee inserts.
packages/desktop-client/src/rules/mutations.ts (1)

285-305: Replace as casts with satisfies to avoid unsoundness.

There are multiple as RuleConditionEntity / as RuleActionEntity casts in this function. Prefer satisfies to retain inference without silencing type checks.

♻️ Example refactor
-          conditions.push({
-            op: 'is',
-            field,
-            value,
-          } as RuleConditionEntity);
+          const condition = {
+            op: 'is',
+            field,
+            value,
+          } satisfies RuleConditionEntity;
+          conditions.push(condition);

As per coding guidelines: "Avoid type assertions (as, !) - prefer satisfies."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/rules/mutations.ts` around lines 285 - 305,
Replace the unsound type assertions in this function by using TypeScript's
"satisfies" operator on the literal objects pushed into conditions and actions:
where you currently do conditions.push({ op: 'is', field, value, } as
RuleConditionEntity) and actions.push({ op: 'set', field: 'notes', value:
transaction.notes, options: { splitIndex: 0 } } as RuleActionEntity), remove the
"as ..." casts and append "satisfies RuleConditionEntity" or "satisfies
RuleActionEntity" to the object expression so the compiler narrows types without
silencing checks (apply this to the objects created in conditionFields.forEach
and the objects pushed when transaction.is_parent &&
transaction.subtransactions).
packages/desktop-client/src/components/ManageRules.tsx (1)

217-244: Don’t await mutate—use mutateAsync or drop async/await.

useMutation().mutate is not async. The current await is a no-op and can mislead future readers. Either remove async/await or switch to mutateAsync if you need a promise.

✅ Option A: remove async/await
-  const onDeleteSelected = async () => {
+  const onDeleteSelected = () => {
     batchDeleteRules(
       {
         ids: [...selectedInst.items],
       },
       {
         onSuccess: () => {
           void refetchRules();
           selectedInst.dispatch({ type: 'select-none' });
         },
       },
     );
   };
-  async function onDeleteRule(id: string) {
-    await deleteRule(
+  function onDeleteRule(id: string) {
+    deleteRule(
       { id },
       {
         onSuccess: () => {
           void refetchRules();
         },
       },
     );
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/ManageRules.tsx` around lines 217 -
244, The handlers onDeleteSelected and onDeleteRule are awaiting non-async
mutate functions; update them to either call the async variants or remove
async/await: for example replace batchDeleteRules(...) with await
batchDeleteRules.mutateAsync({...}) (or drop async/await and call
batchDeleteRules({...}) directly) and similarly replace deleteRule(...) with
await deleteRule.mutateAsync({ id }) or remove async/await and call deleteRule({
id }). Keep the existing onSuccess callbacks (refetchRules and
selectedInst.dispatch) intact when switching to mutateAsync or when keeping
mutate.
packages/desktop-client/src/components/filters/FiltersMenu.tsx (1)

299-331: Avoid any in the GenericInput onChange handler.

Since this block was touched, consider tightening the type on onChange to avoid any and keep the reducer typed (e.g., T['value']). This aligns with the repo’s TS guidelines.

✅ Example tightening
-              // oxlint-disable-next-line typescript/no-explicit-any
-              onChange={(v: any) => {
+              onChange={(v: T['value']) => {
                 dispatch({ type: 'set-value', value: v });
               }}

As per coding guidelines, Avoid any or unknown unless absolutely necessary.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/filters/FiltersMenu.tsx` around lines
299 - 331, The onChange handler for GenericInput uses an any-typed parameter;
replace that with a concrete type pulled from the GenericInput prop or your
filter state so the reducer stays typed. Locate the GenericInput usage in
FiltersMenu.tsx (the onChange that calls dispatch({ type: 'set-value', value: v
})) and change the parameter type from any to the proper value type (for example
the GenericInput onChange prop type or the FilterState/Reducer action payload
type such as T['value'] or the exported type used by GenericInput), updating
imports/types if necessary so dispatch({ type: 'set-value', value: v }) remains
correctly typed without using any.
packages/desktop-client/src/rules/queries.ts (1)

6-20: Prefer function/method syntax and satisfies over as const for query keys.

To align with TS guidelines, avoid const assertions and use function/method syntax for pure functions. You can keep the tuple typing with satisfies.

✅ Example adjustment
-export const ruleQueries = {
-  all: () => ['rules'] as const,
-  lists: () => [...ruleQueries.all(), 'lists'] as const,
+export const ruleQueries = {
+  all() {
+    return ['rules'] satisfies readonly ['rules'];
+  },
+  lists() {
+    return [...ruleQueries.all(), 'lists'] satisfies readonly ['rules', 'lists'];
+  },
   list: () =>
     queryOptions<RuleEntity[]>({
-      queryKey: [...ruleQueries.lists()],
+      queryKey: [...ruleQueries.lists()],
       queryFn: async () => {
         return await send('rules-get');
       },
       staleTime: Infinity,
     }),

As per coding guidelines, Use the function keyword for pure functions - prefer functional and declarative programming patterns. Avoid type assertions (as, !) - prefer satisfies.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/rules/queries.ts` around lines 6 - 20, Change the
query key helpers to use named function declarations (use the function keyword)
instead of arrow functions and replace "as const" assertions with tuple typing
using "satisfies"; specifically update ruleQueries.all, ruleQueries.lists, and
any queryKey arrays inside list and listPayee to return typed tuples that use
"satisfies readonly [...] " (or appropriate tuple type) rather than casting with
as const, and keep queryOptions usages (in list and listPayee) referencing those
function results for queryKey so the keys remain strongly typed without const
assertions.
packages/loot-core/src/shared/rules.ts (1)

98-113: Avoid as unknown as in FIELD_TYPES mapping.

The double assertion makes the typing brittle. Consider centralizing the typing with a small typedEntries helper to localize the cast, where a single assertion is more acceptable than the double cast pattern.

♻️ Example refactor (helper localizes the necessary assertion)
+const typedEntries = <T extends Record<string, { type: keyof typeof TYPE_INFO }>>(
+  obj: T,
+) => Object.entries(obj) as Array<[keyof T, T[keyof T]]>;
+
 export const FIELD_TYPES = new Map(
-  Object.entries(FIELD_INFO).map(
-    ([field, info]) =>
-      [field as unknown as keyof FieldValueTypes, info.type] as const,
-  ),
+  typedEntries(FIELD_INFO).map(([field, info]) => [field, info.type] as const),
 );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/loot-core/src/shared/rules.ts` around lines 98 - 113, The
FIELD_TYPES map uses a brittle double-cast ([field as unknown as keyof
FieldValueTypes])—replace that pattern by introducing a small typedEntries
helper and use it in the FIELD_TYPES initialization so the key/value types are
preserved without ad-hoc casts; update the export const FIELD_TYPES to call
typedEntries(FIELD_INFO).map(...) (referencing FIELD_TYPES, FIELD_INFO, and
FieldValueTypes) and ensure the helper signature localizes the single, explicit
assertion instead of scattering casts across the codebase.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/desktop-client/src/components/ManageRules.tsx`:
- Around line 387-401: Replace the plain string i18n call in the Tooltip's
content prop with a React <Trans> element: in the Tooltip around the Delete
button (Tooltip component with props isOpen={isNonDeletableRuleSelected} and
content={...}), stop passing t('Some selected rules cannot be deleted because
they are linked to schedules.') and instead render a <Trans> component
containing that message so the Tooltip receives a React node; keep existing
props (isOpen) and handlers (onDeleteSelected, selectedInst.items.size)
unchanged.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`:
- Around line 114-132: The handleRuleDelete useCallback closes over the
deleteRule function from useDeleteRuleMutation but does not include it in the
dependency array; update the dependency list for the useCallback that defines
handleRuleDelete to include deleteRule (in addition to dispatch,
showUndoNotification, t, refetchRules) so the callback updates if the mutation
hook returns a new function; locate the handleRuleDelete const and its
useCallback invocation and add deleteRule to the dependency array.

In `@packages/desktop-client/src/components/schedules/schedule-edit-utils.ts`:
- Around line 4-15: The filtered array in updateScheduleConditions currently
contains (RuleConditionEntity | null) items because .filter(val => !!val)
doesn't act as a TypeScript type predicate; change the filter to an explicit
type guard so the result is narrowed to RuleConditionEntity[] (e.g. replace the
.filter callback with a predicate like (val): val is RuleConditionEntity => val
!= null) and return that narrowed array from updateScheduleConditions so the
function signature { error?: string; conditions?: RuleConditionEntity[] } is
satisfied.

In `@packages/desktop-client/src/components/transactions/TransactionList.tsx`:
- Around line 253-255: The mutation returned from
useCreateSingleTimeScheduleFromTransaction is currently destructured as mutate
(createSingleTimeScheduleFromTransaction) and used fire-and-forget, so success
notification and onRefetch() may run before the schedule is created; change to
destructure mutateAsync (e.g., const { mutateAsync:
createSingleTimeScheduleFromTransaction } =
useCreateSingleTimeScheduleFromTransaction()) and await
createSingleTimeScheduleFromTransaction(...) so that you only show the success
notification and call onRefetch() after the awaited mutation resolves (and
handle errors if it rejects).

In `@packages/desktop-client/src/rules/mutations.ts`:
- Around line 389-394: The call to updateRule (a mutateAsync) is not awaited,
which can drop rejections and return before changes persist; modify the
invocation in the code that builds the new rule (where rule,
linkScheduleActions, and actions are combined) to await updateRule(...) or use
void updateRule(...) so the promise is handled—ensure you reference the
updateRule mutateAsync call and await its result (or explicitly void it) to
capture errors and guarantee the update completes.
- Around line 28-31: The invalidateQueries helper currently defaults to
ruleQueries.lists(), which misses payee-specific caches (e.g.,
ruleQueries.listPayee uses ruleQueries.all()+payeeId); change the default
queryKey passed into queryClient.invalidateQueries in invalidateQueries to use
ruleQueries.all() instead of ruleQueries.lists() so all rule-related queries
(including payee-specific ones) are invalidated after mutations.
- Around line 362-365: The auto-generated user-facing string assigned to
scheduleName should be localized; replace the hard-coded template with a
translated string using the app i18n function (e.g., t(...)) and interpolation
(use the same variables formattedDate and timestamp) so the label is produced
via translation rather than a literal; update the code around formattedDate,
timestamp, and scheduleName in mutations.ts to call t with a descriptive key and
pass { formattedDate, timestamp } (or equivalent) as interpolation params.

In `@packages/loot-core/src/server/api.ts`:
- Around line 779-795: The handlers api/rule-create and api/rule-update wrap all
errors and rethrow them as a generic APIError which masks infra errors and
passes an untyped unknown as meta; either remove the outer try/catch entirely so
errors from handlers['rule-add'] and handlers['rule-update'] propagate
unchanged, or narrow the catch to only handle validation-shaped errors (e.g.,
test for a ValidationError-like object returned by rules/app.ts) and rethrow
APIError with the correctly typed meta ({ conditionErrors: string[];
actionErrors: string[] }), while rethrowing any other errors unchanged.

---

Outside diff comments:
In `@packages/desktop-client/src/components/accounts/Account.tsx`:
- Around line 712-739: The two user-facing notification strings must be
localized: wrap the formula error summary and the generic failure message with
the i18n t() function (ensure t is imported where Account.tsx defines methods
like the try/catch around apply rules); for the formula error use a translation
key with a placeholder and pass errors: allErrors.join('\n') (i.e., message:
t('accounts.formulaErrors', { errors: allErrors.join('\n') }) or similar) and
replace the hardcoded 'Failed to apply rules to transactions' with
t('accounts.applyRulesFailed'); keep the notifications created via
addNotification unchanged except for replacing message values, and ensure any
newline formatting is preserved via the placeholder.

In `@packages/desktop-client/src/components/filters/FiltersMenu.tsx`:
- Around line 26-32: The code still calls the removed function unparse (causing
a compile error) — replace that call with unparseConditions so the imported
symbol is used; update the invocation at the FiltersMenu component where
unparse(...) is called to unparseConditions(...) with the same arguments,
ensuring you remove any lingering references to unparse and rely on the
already-imported unparseConditions.

In
`@packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx`:
- Around line 677-792: The onSaveInner callback uses the mutation function
createSingleTimeScheduleFromTransaction but doesn't list it in its dependency
array, violating react-hooks/exhaustive-deps; update the dependency array for
onSaveInner (the useCallback that defines onSaveInner) to include
createSingleTimeScheduleFromTransaction so the hook re-evaluates when that
mutation function changes.
- Around line 1421-1479: The onUpdate callback (defined with useCallback)
references runRulesAsync from useRunRulesMutation but runRulesAsync is missing
from its dependency array; update the dependency array for onUpdate to include
runRulesAsync (in addition to dateFormat and transactions) so the callback
updates correctly when the mutation function changes.

In `@packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx`:
- Around line 64-83: The onMerge useCallback closes over addPayeeRenameRuleAsync
(and also uses send) but the dependency array only lists shouldCreateRule,
isEditingRule, and payees; update the dependency array for the onMerge callback
(the one declared with useCallback in MergeUnusedPayeesModal.tsx) to include
addPayeeRenameRuleAsync (and send if it comes from props/hooks) so the hook
doesn't capture a stale closure and satisfies lint rules.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx`:
- Around line 1008-1062: The splitIndex extraction in the actionSplits
initializer can throw if action.options is undefined and the initial accumulator
uses a type assertion; update the reducer in the actionSplits useState (the
block that calls parseActions on defaultRule.actions and reduces into
actionSplits) to use optional chaining when reading splitIndex (e.g.,
action.options?.splitIndex ?? 0) and remove the "as (typeof actionSplits)[0]"
assertion by constructing the initial accumulator with an explicitly shaped
object that matches the actionSplits element type (id: uuid(), actions: []) or
by casting the whole useState generic instead of asserting the initial value.

In `@packages/desktop-client/src/hooks/usePreviewTransactions.ts`:
- Around line 76-143: The useEffect in the usePreviewTransactions hook closes
over runRulesAsync (from useRunRulesMutation) but the dependency array only
lists scheduleTransactions, schedules, statuses, and upcomingLength; update the
effect's dependency array to include runRulesAsync so the effect re-runs when
the mutation function changes and to satisfy the hooks lint rule; locate the
useEffect block inside usePreviewTransactions and add runRulesAsync to the array
of dependencies.
- Around line 76-95: The preview hook usePreviewTransactions currently calls
runRulesAsync (from useRunRulesMutation) for each scheduleTransactions which
triggers query invalidations and error notifications; change this to a
non-user-facing path by either (1) invoking a lightweight helper that dispatches
the rule engine without side effects (e.g., call send('rules-run') /
applyRulesSilently) from inside usePreviewTransactions, or (2) extend
useRunRulesMutation to accept a silent option (e.g., { silent: true } or {
noInvalidate: true }) and pass that option when calling runRulesAsync so it
applies rules for previews without invalidating queries or emitting
notifications; update the call sites in usePreviewTransactions (where
runRulesAsync is used) to use the new silent helper/option and ensure the
mutation implementation checks that flag and skips invalidation/notification
logic.

---

Nitpick comments:
In `@packages/desktop-client/src/components/accounts/Account.tsx`:
- Around line 1059-1062: realizeTempTransactions always returns exactly one
reconciliation transaction, so calling Promise.all on reconciliationTransactions
with runRules risks concurrent inserts (runRules → finalizeTransactionForRules)
and is unnecessary; replace the Promise.all call in Account.tsx with a
sequential await loop (e.g., for/for-of) that calls this.props.onRunRules
(runRules) for each transaction to ensure runs execute one-by-one and avoid
duplicate payee inserts.

In `@packages/desktop-client/src/components/filters/FiltersMenu.tsx`:
- Around line 299-331: The onChange handler for GenericInput uses an any-typed
parameter; replace that with a concrete type pulled from the GenericInput prop
or your filter state so the reducer stays typed. Locate the GenericInput usage
in FiltersMenu.tsx (the onChange that calls dispatch({ type: 'set-value', value:
v })) and change the parameter type from any to the proper value type (for
example the GenericInput onChange prop type or the FilterState/Reducer action
payload type such as T['value'] or the exported type used by GenericInput),
updating imports/types if necessary so dispatch({ type: 'set-value', value: v })
remains correctly typed without using any.

In `@packages/desktop-client/src/components/ManageRules.tsx`:
- Around line 217-244: The handlers onDeleteSelected and onDeleteRule are
awaiting non-async mutate functions; update them to either call the async
variants or remove async/await: for example replace batchDeleteRules(...) with
await batchDeleteRules.mutateAsync({...}) (or drop async/await and call
batchDeleteRules({...}) directly) and similarly replace deleteRule(...) with
await deleteRule.mutateAsync({ id }) or remove async/await and call deleteRule({
id }). Keep the existing onSuccess callbacks (refetchRules and
selectedInst.dispatch) intact when switching to mutateAsync or when keeping
mutate.

In `@packages/desktop-client/src/hooks/useRules.ts`:
- Line 8: UseRulesOptions is currently unexported which forces callers to inline
its definition; export the type so external consumers can reference it. Update
the declaration of UseRulesOptions to be exported (export type UseRulesOptions =
Pick<UseQueryOptions<RuleEntity[]>, 'enabled'>) and ensure the module's public
exports include it alongside useRules so callers can import UseRulesOptions
directly.

In `@packages/desktop-client/src/rules/mutations.ts`:
- Around line 285-305: Replace the unsound type assertions in this function by
using TypeScript's "satisfies" operator on the literal objects pushed into
conditions and actions: where you currently do conditions.push({ op: 'is',
field, value, } as RuleConditionEntity) and actions.push({ op: 'set', field:
'notes', value: transaction.notes, options: { splitIndex: 0 } } as
RuleActionEntity), remove the "as ..." casts and append "satisfies
RuleConditionEntity" or "satisfies RuleActionEntity" to the object expression so
the compiler narrows types without silencing checks (apply this to the objects
created in conditionFields.forEach and the objects pushed when
transaction.is_parent && transaction.subtransactions).

In `@packages/desktop-client/src/rules/queries.ts`:
- Around line 6-20: Change the query key helpers to use named function
declarations (use the function keyword) instead of arrow functions and replace
"as const" assertions with tuple typing using "satisfies"; specifically update
ruleQueries.all, ruleQueries.lists, and any queryKey arrays inside list and
listPayee to return typed tuples that use "satisfies readonly [...] " (or
appropriate tuple type) rather than casting with as const, and keep queryOptions
usages (in list and listPayee) referencing those function results for queryKey
so the keys remain strongly typed without const assertions.

In `@packages/loot-core/src/server/rules/app.ts`:
- Around line 126-134: The return of isSuccess in deleteRule is misleading
because after the guard `if (!isSuccess) throw ...` the variable can only be
true; update the function to make intent clear by returning a literal true
instead of `isSuccess` (or alternatively remove the variable and directly `await
rules.deleteRule(id)` then return true); locate the deleteRule function and the
`isSuccess` assignment from `rules.deleteRule(id)` and change the final `return
isSuccess;` to `return true;` (or simplify by omitting `isSuccess` and returning
true after the throw guard).
- Around line 106-123: The validateRule call presently returns a plain object
which is thrown (in addRule and updateRule), losing stack and Error semantics;
change this by creating/using a real Error subclass (e.g., class ValidationError
extends Error that accepts conditionErrors and actionErrors and sets them as
properties, capturing the stack) and replace the raw throws in addRule and
updateRule with throwing a new instance (e.g., throw new
ValidationError(conditionErrors, actionErrors)); ensure the ValidationError
constructor sets name, message, the two error arrays, and captures stack (via
Error.captureStackTrace or super()) so downstream instanceof Error checks and
stack traces work.

In `@packages/loot-core/src/shared/rules.ts`:
- Around line 98-113: The FIELD_TYPES map uses a brittle double-cast ([field as
unknown as keyof FieldValueTypes])—replace that pattern by introducing a small
typedEntries helper and use it in the FIELD_TYPES initialization so the
key/value types are preserved without ad-hoc casts; update the export const
FIELD_TYPES to call typedEntries(FIELD_INFO).map(...) (referencing FIELD_TYPES,
FIELD_INFO, and FieldValueTypes) and ensure the helper signature localizes the
single, explicit assertion instead of scattering casts across the codebase.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4bd301 and fbc1025.

📒 Files selected for processing (27)
  • packages/desktop-client/src/components/ManageRules.tsx
  • packages/desktop-client/src/components/accounts/Account.tsx
  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
  • packages/desktop-client/src/components/mobile/rules/MobileRuleEditPage.tsx
  • packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
  • packages/desktop-client/src/components/mobile/schedules/MobileScheduleEditPage.tsx
  • packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
  • packages/desktop-client/src/components/modals/ManageRulesModal.tsx
  • packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
  • packages/desktop-client/src/components/rules/RuleEditor.tsx
  • packages/desktop-client/src/components/rules/ScheduleValue.tsx
  • packages/desktop-client/src/components/rules/Value.tsx
  • packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
  • packages/desktop-client/src/components/schedules/schedule-edit-utils.ts
  • packages/desktop-client/src/components/transactions/TransactionList.tsx
  • packages/desktop-client/src/hooks/usePayeeRules.ts
  • packages/desktop-client/src/hooks/usePreviewTransactions.ts
  • packages/desktop-client/src/hooks/useRules.ts
  • packages/desktop-client/src/rules/index.ts
  • packages/desktop-client/src/rules/mutations.ts
  • packages/desktop-client/src/rules/queries.ts
  • packages/loot-core/src/server/api.ts
  • packages/loot-core/src/server/rules/app.ts
  • packages/loot-core/src/server/schedules/app.ts
  • packages/loot-core/src/server/transactions/transaction-rules.ts
  • packages/loot-core/src/shared/rules.ts
  • packages/loot-core/src/types/models/rule.ts
💤 Files with no reviewable changes (1)
  • packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx

Comment on lines +114 to 132
const { mutate: deleteRule } = useDeleteRuleMutation();

const handleRuleDelete = useCallback(
async (rule: RuleEntity) => {
try {
const { someDeletionsFailed } = await send('rule-delete-all', [
rule.id,
]);

if (someDeletionsFailed) {
dispatch(
addNotification({
notification: {
type: 'warning',
message: t(
'This rule could not be deleted because it is linked to a schedule.',
),
},
}),
);
} else {
showUndoNotification({
message: t('Rule deleted successfully'),
});
}

// Refresh the rules list
await loadRules();
} catch (error) {
console.error('Failed to delete rule:', error);
dispatch(
addNotification({
notification: {
type: 'error',
message: t('Failed to delete rule. Please try again.'),
},
}),
);
}
deleteRule(
{ id: rule.id },
{
onSuccess: () => {
showUndoNotification({
message: t('Rule deleted successfully'),
});
// Refresh the rules list
void refetchRules();
},
},
);
},
[dispatch, showUndoNotification, t, loadRules],
[dispatch, showUndoNotification, t, refetchRules],
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Include deleteRule in the callback deps.

handleRuleDelete now closes over deleteRule from the mutation hook, but it isn’t listed in the dependency array.

🔧 Suggested change
-    [dispatch, showUndoNotification, t, refetchRules],
+    [deleteRule, dispatch, showUndoNotification, t, refetchRules],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`
around lines 114 - 132, The handleRuleDelete useCallback closes over the
deleteRule function from useDeleteRuleMutation but does not include it in the
dependency array; update the dependency list for the useCallback that defines
handleRuleDelete to include deleteRule (in addition to dispatch,
showUndoNotification, t, refetchRules) so the callback updates if the mutation
hook returns a new function; locate the handleRuleDelete const and its
useCallback invocation and add deleteRule to the dependency array.

Comment thread packages/loot-core/src/server/api.ts Resolved
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Auto-generated Release Notes

Hey @joel-jeremy! I've automatically created a release notes file based on CodeRabbit's analysis:

Category: Features
Summary: Introduce React Query hooks for rules management, enhancing data-fetching and mutation capabilities.
File: upcoming-release-notes/7070.md

If you're happy with this release note, you can add it to your pull request. If not, you'll need to add your own before a maintainer can review your change.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (6)
packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx (1)

114-132: deleteRule is now present in the dependency array.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`
around lines 114 - 132, The dependency array for handleRuleDelete contains a
duplicate entry for deleteRule; update the useCallback dependency array in
MobileRulesPage.tsx (the handleRuleDelete definition that uses
useDeleteRuleMutation, showUndoNotification, t, and refetchRules) to include
each dependency only once — i.e., ensure [deleteRule, showUndoNotification, t,
refetchRules] contains no duplicates and remove the extra deleteRule entry.
packages/desktop-client/src/rules/mutations.ts (3)

28-31: ⚠️ Potential issue | 🟠 Major

Invalidate all rule queries, not just lists.

Defaulting to ruleQueries.lists() misses payee-specific caches. Prefer ruleQueries.all() to keep the whole rule surface fresh.

🔧 Suggested change
 function invalidateQueries(queryClient: QueryClient, queryKey?: QueryKey) {
   void queryClient.invalidateQueries({
-    queryKey: queryKey ?? ruleQueries.lists(),
+    queryKey: queryKey ?? ruleQueries.all(),
   });
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/rules/mutations.ts` around lines 28 - 31, The
invalidateQueries function currently defaults to ruleQueries.lists(), which
misses payee-specific caches; update the default queryKey to ruleQueries.all()
so that invalidateQueries(queryClient: QueryClient, queryKey?: QueryKey) calls
queryClient.invalidateQueries({ queryKey: queryKey ?? ruleQueries.all() })
ensuring the entire rule surface (not just lists) is invalidated.

362-365: ⚠️ Potential issue | 🟡 Minor

Localize the auto-generated schedule name.

This string is user-facing and should be translated.

🌐 Suggested change
-      const scheduleName = `Auto-created future transaction (${formattedDate}) - ${timestamp}`;
+      const scheduleName = t(
+        'Auto-created future transaction ({{date}}) - {{timestamp}}',
+        { date: formattedDate, timestamp },
+      );

As per coding guidelines: Custom ESLint rule actual/no-untranslated-strings enforces i18n usage - add i18n translations for user-facing strings.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/rules/mutations.ts` around lines 362 - 365, The
auto-generated user-facing string in mutations.ts (variables formattedDate,
timestamp, scheduleName) must be localized: replace the hardcoded template
`Auto-created future transaction (${formattedDate}) - ${timestamp}` with a call
to the app's i18n translate function (e.g., t or i18n.t) using a translation key
like "auto_created_future_transaction" and pass formattedDate and timestamp as
interpolation variables; update usages of scheduleName accordingly and add the
new key/placeholder to the locale files.

389-394: ⚠️ Potential issue | 🟠 Major

Await the rule update to avoid dropped rejections.

updateRule is async; awaiting ensures completion and surfaces failures.

✅ Suggested change
-            updateRule({
+            await updateRule({
               rule: {
                 ...rule,
                 actions: [...linkScheduleActions, ...actions],
               },
             });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/rules/mutations.ts` around lines 389 - 394, The
call to updateRule is currently not awaited which can drop rejections; change
the invocation inside the mutation to await updateRule({ rule: { ...rule,
actions: [...linkScheduleActions, ...actions] } }); and either return the
awaited promise or wrap it in a try/catch and rethrow/log the error so failures
are propagated (reference the updateRule function and the local variables rule,
linkScheduleActions, actions to locate the call).
packages/desktop-client/src/components/transactions/TransactionList.tsx (1)

253-281: ⚠️ Potential issue | 🟠 Major

Await the schedule-creation mutation before success/refetch.

mutate is fire-and-forget, so onConfirm completes before the schedule exists, and the refetch can run too early. Switch to mutateAsync and await it.

✅ Suggested fix
-  const { mutate: createSingleTimeScheduleFromTransaction } =
-    useCreateSingleTimeScheduleFromTransaction();
+  const { mutateAsync: createSingleTimeScheduleFromTransaction } =
+    useCreateSingleTimeScheduleFromTransaction();
@@
-            createSingleTimeScheduleFromTransaction({
+            await createSingleTimeScheduleFromTransaction({
               transaction: transactionWithSubtransactions,
             });
@@
-              createSingleTimeScheduleFromTransaction({ transaction });
+              await createSingleTimeScheduleFromTransaction({ transaction });

Also applies to: 339-347

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/transactions/TransactionList.tsx`
around lines 253 - 281, The schedule-creation mutation is being fired without
awaiting, causing onConfirm to finish (and refetch to run) before the schedule
exists; change the destructured mutate from
useCreateSingleTimeScheduleFromTransaction to mutateAsync (e.g., const {
mutateAsync: createSingleTimeScheduleFromTransaction } =
useCreateSingleTimeScheduleFromTransaction()) and then await
createSingleTimeScheduleFromTransaction(...) inside the
promptToConvertToSchedule onConfirm async callback(s) (the one building
transactionWithSubtransactions and the similar occurrence around the other
prompt in the file) so the function completes only after the schedule creation
finishes.
packages/desktop-client/src/components/ManageRules.tsx (1)

387-392: ⚠️ Potential issue | 🟡 Minor

Use <Trans> for tooltip content.

✅ Suggested change
-              <Tooltip
-                isOpen={isNonDeletableRuleSelected}
-                content={t(
-                  'Some selected rules cannot be deleted because they are linked to schedules.',
-                )}
-              >
+              <Tooltip
+                isOpen={isNonDeletableRuleSelected}
+                content={
+                  <Trans>
+                    Some selected rules cannot be deleted because they are
+                    linked to schedules.
+                  </Trans>
+                }
+              >

As per coding guidelines: Use Trans component instead of t() function when possible - all user-facing strings must be translated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/ManageRules.tsx` around lines 387 -
392, Replace the inline t(...) string passed to Tooltip with a Trans component
so the tooltip content uses JSX translation: in ManageRules.tsx locate the
Tooltip where isNonDeletableRuleSelected is used and change the content prop
from t('Some selected rules cannot be deleted because they are linked to
schedules.') to a <Trans> element containing that sentence (import Trans from
'react-i18next' if not present); ensure the same translation key/text is
available in your locales or update keys accordingly so the tooltip remains
translated.
🧹 Nitpick comments (3)
packages/loot-core/src/server/schedules/app.ts (1)

6-22: Use inline type imports for style consistency.

These are type-only imports; prefer inline type specifiers in the import list.

♻️ Suggested change
-import type { WithRequired } from 'loot-core/types/util';
+import { type WithRequired } from 'loot-core/types/util';
@@
-import type { RuleConditionEntity, ScheduleEntity } from '../../types/models';
+import { type RuleConditionEntity, type ScheduleEntity } from '../../types/models';

As per coding guidelines: Use inline type imports: import { type MyType } from '...'.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/loot-core/src/server/schedules/app.ts` around lines 6 - 22, The
import list uses bare type imports; change them to inline type specifiers to
follow style (e.g. import { type WithRequired } from 'loot-core/types/util' and
import { type RuleConditionEntity, type ScheduleEntity } from
'../../types/models'); update the top imports where WithRequired,
RuleConditionEntity, and ScheduleEntity are referenced so each type is imported
with the inline "type" keyword and leave non-type imports (captureBreadcrumb,
connection, logger, currentDay, dayFromDate, parseDate, q, extractScheduleConds,
getDateWithSkippedWeekend, getHasTransactionsQuery, getNextDate,
getScheduledAmount, getStatus, recurConfigToRSchedule) unchanged.
packages/desktop-client/src/rules/mutations.ts (2)

277-342: Replace as casts with satisfies for rule literals.

This keeps the literals checked without unsafe assertions.

♻️ Example adjustment
-          conditions.push({
-            op: 'is',
-            field,
-            value,
-          } as RuleConditionEntity);
+          conditions.push({
+            op: 'is',
+            field,
+            value,
+          } satisfies RuleConditionEntity);
@@
-          actions.push({
+          actions.push({
             op: 'set',
             field: 'notes',
             value: split.notes,
             options: { splitIndex },
-          } as RuleActionEntity);
+          } satisfies RuleActionEntity);

As per coding guidelines: Avoid type assertions (as, !) - prefer satisfies.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/rules/mutations.ts` around lines 277 - 342,
Replace the unsafe "as" casts for the literal objects with TypeScript
"satisfies" checks so the literals are type-validated without asserting; update
the initial arrays (conditions: RuleConditionEntity[] and actions:
RuleActionEntity[]) and every object pushed into them (the date condition, the
loop over conditionFields, and the action objects created inside the
transaction.is_parent && transaction.subtransactions branch and its
subtransaction handling) to use "satisfies RuleConditionEntity" or "satisfies
RuleActionEntity" respectively instead of "as RuleConditionEntity"/"as
RuleActionEntity", ensuring the shapes of the objects (fields like op, field,
value, options, splitIndex, method) are verified by the compiler.

3-18: Prefer inline type imports to match repo style.

♻️ Suggested change
-import { useMutation, useQueryClient } from '@tanstack/react-query';
-import type { QueryClient, QueryKey } from '@tanstack/react-query';
+import {
+  useMutation,
+  useQueryClient,
+  type QueryClient,
+  type QueryKey,
+} from '@tanstack/react-query';
@@
-import type {
+import {
+  type NewRuleEntity,
+  type PayeeEntity,
+  type RuleActionEntity,
+  type RuleConditionEntity,
+  type RuleEntity,
+  type ScheduleEntity,
+  type TransactionEntity,
+} from 'loot-core/types/models';

As per coding guidelines: Use inline type imports: import { type MyType } from '...'.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/rules/mutations.ts` around lines 3 - 18, Replace
top-level `import type` usages with inline `type` imports to match repo style:
change `import type { QueryClient, QueryKey } from '@tanstack/react-query';` to
`import { type QueryClient, type QueryKey } from '@tanstack/react-query';` and
change `import type { NewRuleEntity, PayeeEntity, RuleActionEntity,
RuleConditionEntity, RuleEntity, ScheduleEntity, TransactionEntity } from
'loot-core/types/models';` to `import { type NewRuleEntity, type PayeeEntity,
type RuleActionEntity, type RuleConditionEntity, type RuleEntity, type
ScheduleEntity, type TransactionEntity } from 'loot-core/types/models';` so all
type-only imports use the inline `type` specifier (refer to the import
statements and the listed type names).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`:
- Around line 116-131: handleRuleDelete currently is marked async but never
awaits, and its per-call onSuccess redundantly calls refetchRules even though
useDeleteRuleMutation already invalidates queries; remove the async keyword from
handleRuleDelete and drop the void refetchRules() call inside the onSuccess
handler so the per-call onSuccess only calls showUndoNotification; keep
deleteRule invocation and leave global onSuccess/invalidation in
useDeleteRuleMutation to trigger the actual refetch.
- Line 28: Remove the unused Redux binding: delete the import of useDispatch and
the local assignment const dispatch = useDispatch() inside the MobileRulesPage
component since dispatch is never used after migrating to the mutation hook;
update the imports and component body to remove any references to
useDispatch/dispatch (search for useDispatch and dispatch in MobileRulesPage) so
there is no dead code.

---

Duplicate comments:
In `@packages/desktop-client/src/components/ManageRules.tsx`:
- Around line 387-392: Replace the inline t(...) string passed to Tooltip with a
Trans component so the tooltip content uses JSX translation: in ManageRules.tsx
locate the Tooltip where isNonDeletableRuleSelected is used and change the
content prop from t('Some selected rules cannot be deleted because they are
linked to schedules.') to a <Trans> element containing that sentence (import
Trans from 'react-i18next' if not present); ensure the same translation key/text
is available in your locales or update keys accordingly so the tooltip remains
translated.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`:
- Around line 114-132: The dependency array for handleRuleDelete contains a
duplicate entry for deleteRule; update the useCallback dependency array in
MobileRulesPage.tsx (the handleRuleDelete definition that uses
useDeleteRuleMutation, showUndoNotification, t, and refetchRules) to include
each dependency only once — i.e., ensure [deleteRule, showUndoNotification, t,
refetchRules] contains no duplicates and remove the extra deleteRule entry.

In `@packages/desktop-client/src/components/transactions/TransactionList.tsx`:
- Around line 253-281: The schedule-creation mutation is being fired without
awaiting, causing onConfirm to finish (and refetch to run) before the schedule
exists; change the destructured mutate from
useCreateSingleTimeScheduleFromTransaction to mutateAsync (e.g., const {
mutateAsync: createSingleTimeScheduleFromTransaction } =
useCreateSingleTimeScheduleFromTransaction()) and then await
createSingleTimeScheduleFromTransaction(...) inside the
promptToConvertToSchedule onConfirm async callback(s) (the one building
transactionWithSubtransactions and the similar occurrence around the other
prompt in the file) so the function completes only after the schedule creation
finishes.

In `@packages/desktop-client/src/rules/mutations.ts`:
- Around line 28-31: The invalidateQueries function currently defaults to
ruleQueries.lists(), which misses payee-specific caches; update the default
queryKey to ruleQueries.all() so that invalidateQueries(queryClient:
QueryClient, queryKey?: QueryKey) calls queryClient.invalidateQueries({
queryKey: queryKey ?? ruleQueries.all() }) ensuring the entire rule surface (not
just lists) is invalidated.
- Around line 362-365: The auto-generated user-facing string in mutations.ts
(variables formattedDate, timestamp, scheduleName) must be localized: replace
the hardcoded template `Auto-created future transaction (${formattedDate}) -
${timestamp}` with a call to the app's i18n translate function (e.g., t or
i18n.t) using a translation key like "auto_created_future_transaction" and pass
formattedDate and timestamp as interpolation variables; update usages of
scheduleName accordingly and add the new key/placeholder to the locale files.
- Around line 389-394: The call to updateRule is currently not awaited which can
drop rejections; change the invocation inside the mutation to await updateRule({
rule: { ...rule, actions: [...linkScheduleActions, ...actions] } }); and either
return the awaited promise or wrap it in a try/catch and rethrow/log the error
so failures are propagated (reference the updateRule function and the local
variables rule, linkScheduleActions, actions to locate the call).

---

Nitpick comments:
In `@packages/desktop-client/src/rules/mutations.ts`:
- Around line 277-342: Replace the unsafe "as" casts for the literal objects
with TypeScript "satisfies" checks so the literals are type-validated without
asserting; update the initial arrays (conditions: RuleConditionEntity[] and
actions: RuleActionEntity[]) and every object pushed into them (the date
condition, the loop over conditionFields, and the action objects created inside
the transaction.is_parent && transaction.subtransactions branch and its
subtransaction handling) to use "satisfies RuleConditionEntity" or "satisfies
RuleActionEntity" respectively instead of "as RuleConditionEntity"/"as
RuleActionEntity", ensuring the shapes of the objects (fields like op, field,
value, options, splitIndex, method) are verified by the compiler.
- Around line 3-18: Replace top-level `import type` usages with inline `type`
imports to match repo style: change `import type { QueryClient, QueryKey } from
'@tanstack/react-query';` to `import { type QueryClient, type QueryKey } from
'@tanstack/react-query';` and change `import type { NewRuleEntity, PayeeEntity,
RuleActionEntity, RuleConditionEntity, RuleEntity, ScheduleEntity,
TransactionEntity } from 'loot-core/types/models';` to `import { type
NewRuleEntity, type PayeeEntity, type RuleActionEntity, type
RuleConditionEntity, type RuleEntity, type ScheduleEntity, type
TransactionEntity } from 'loot-core/types/models';` so all type-only imports use
the inline `type` specifier (refer to the import statements and the listed type
names).

In `@packages/loot-core/src/server/schedules/app.ts`:
- Around line 6-22: The import list uses bare type imports; change them to
inline type specifiers to follow style (e.g. import { type WithRequired } from
'loot-core/types/util' and import { type RuleConditionEntity, type
ScheduleEntity } from '../../types/models'); update the top imports where
WithRequired, RuleConditionEntity, and ScheduleEntity are referenced so each
type is imported with the inline "type" keyword and leave non-type imports
(captureBreadcrumb, connection, logger, currentDay, dayFromDate, parseDate, q,
extractScheduleConds, getDateWithSkippedWeekend, getHasTransactionsQuery,
getNextDate, getScheduledAmount, getStatus, recurConfigToRSchedule) unchanged.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fbc1025 and 8630a4f.

📒 Files selected for processing (10)
  • packages/desktop-client/src/components/ManageRules.tsx
  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
  • packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
  • packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
  • packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
  • packages/desktop-client/src/components/transactions/TransactionList.tsx
  • packages/desktop-client/src/hooks/usePreviewTransactions.ts
  • packages/desktop-client/src/rules/mutations.ts
  • packages/loot-core/src/server/schedules/app.ts
  • upcoming-release-notes/7070.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/desktop-client/src/hooks/usePreviewTransactions.ts
  • packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx (1)

114-129: Remove redundant refetch + unnecessary async in the delete handler.

useDeleteRuleMutation already invalidates rule queries, so the per-call refetchRules() duplicates work. Also, the handler doesn’t await anything.

♻️ Suggested change
-  const handleRuleDelete = useCallback(
-    async (rule: RuleEntity) => {
+  const handleRuleDelete = useCallback(
+    (rule: RuleEntity) => {
       deleteRule(
         { id: rule.id },
         {
           onSuccess: () => {
             showUndoNotification({
               message: t('Rule deleted successfully'),
             });
-            // Refresh the rules list
-            void refetchRules();
           },
         },
       );
     },
-    [deleteRule, showUndoNotification, t, refetchRules],
+    [deleteRule, showUndoNotification, t],
   );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`
around lines 114 - 129, The handleRuleDelete function is marked async and
manually calls refetchRules despite useDeleteRuleMutation already invalidating
queries; remove the unnecessary async keyword, remove the explicit
refetchRules() call inside handleRuleDelete, and update the dependency array for
the useCallback (remove refetchRules) to avoid stale lint warnings; keep
deleteRule, showUndoNotification, and t in the dependency list so
handleRuleDelete remains stable.
🧹 Nitpick comments (4)
packages/desktop-client/src/components/rules/RuleEditor.tsx (2)

966-967: Use function for the pure helper.

♻️ Suggested adjustment
-const getUnparsedActions = splits => getActions(splits).map(unparseActions);
+function getUnparsedActions(splits) {
+  return getActions(splits).map(unparseActions);
+}

As per coding guidelines: Use the function keyword for pure functions - prefer functional and declarative programming patterns.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx` around lines 966
- 967, The two helpers getActions and getUnparsedActions are defined as arrow
functions but must be pure helpers declared with the function keyword; replace
the arrow definitions of getActions and getUnparsedActions with function
declarations (keeping the same parameter name splits and behavior that uses
unparseActions and .flatMap) so callers and hoisting behave consistently.

1026-1027: Avoid the as assertion for the initial split element.

You can model the initial element with a concrete type (or satisfies) and avoid the assertion.

♻️ Suggested adjustment
-      [{ id: uuid(), actions: [] } as (typeof actionSplits)[0]],
+      [
+        ({ id: uuid(), actions: [] } satisfies {
+          id: string;
+          actions: Array<RuleActionEntity & { inputKey: string }>;
+        }),
+      ],

As per coding guidelines: Avoid type assertions (as, !) - prefer satisfies.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx` around lines
1026 - 1027, The initial pre-split element currently uses a type assertion
("as") which should be removed; instead construct the initial element with an
explicit shape or use TypeScript's "satisfies" to ensure it matches the
actionSplits item type. Locate the array literal that creates [{ id: uuid(),
actions: [] } as (typeof actionSplits)[0]] and replace the assertion by either
declaring the element with the concrete interface/type used by actionSplits or
append "satisfies (typeof actionSplits)[0]" so the value is type-checked without
an "as" cast (keeping uuid() and actions:[] intact). Ensure imports/types
required for the concrete type are available and adjust the expression
accordingly.
packages/desktop-client/src/components/ManageRules.tsx (2)

217-244: Avoid redundant refetches after delete mutations.

Both delete mutations already invalidate rule queries; the extra refetchRules() triggers a second fetch. Dropping it keeps UX the same while reducing duplicate work.

♻️ Suggested change
     batchDeleteRules(
       {
         ids: [...selectedInst.items],
       },
       {
         onSuccess: () => {
-          void refetchRules();
           selectedInst.dispatch({ type: 'select-none' });
         },
       },
     );
   };

   function onDeleteRule(id: string) {
-    deleteRule(
-      { id },
-      {
-        onSuccess: () => {
-          void refetchRules();
-        },
-      },
-    );
+    deleteRule({ id });
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/ManageRules.tsx` around lines 217 -
244, The onDeleteSelected and onDeleteRule handlers call refetchRules() inside
their onSuccess callbacks even though batchDeleteRules and deleteRule mutations
already invalidate the rules queries; remove the explicit void refetchRules()
calls from onSuccess in both onDeleteSelected (where batchDeleteRules is called)
and onDeleteRule (where deleteRule is called) so the query invalidation handles
refetching and avoids duplicate fetches, retaining the selectedInst.dispatch
call in onDeleteSelected and keeping onSuccess otherwise unchanged.

129-153: Gate payee-rule fetching/loading when payeeId is null.

usePayeeRules still runs for the all-rules view, and its loading flags are folded into isLoading. That can trigger an unnecessary request and spinner even when only useRules is relevant. Consider disabling the payee query when payeeId is falsy, or at least excluding its loading flags in that case.

♻️ Suggested adjustment
-  const isLoading =
-    isAllRulesLoading ||
-    isAllRulesRefetching ||
-    isPayeeRulesLoading ||
-    isPayeeRulesRefetching;
+  const isLoading = payeeId
+    ? isPayeeRulesLoading || isPayeeRulesRefetching
+    : isAllRulesLoading || isAllRulesRefetching;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/ManageRules.tsx` around lines 129 -
153, The payee-specific query is running even when payeeId is null which causes
unnecessary requests and makes isLoading reflect payee flags; update the
usePayeeRules call to disable the query when payeeId is falsy (e.g., pass an
enabled: !!payeeId option) and/or change the isLoading computation to only
include isPayeeRulesLoading and isPayeeRulesRefetching when payeeId is truthy;
adjust refetchRules to keep the existing ternary (refetchPayeeRules vs
refetchAllRules) so behavior stays correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/desktop-client/src/components/rules/RuleEditor.tsx`:
- Around line 1018-1021: The guard for reading splitIndex is unsafe because
"'splitIndex' in action.options" will throw if action.options is undefined;
update the computation of splitIndex in RuleEditor.tsx to use a safe optional
check such as using optional chaining or a fallback object (e.g. compute
splitIndex from action.options?.splitIndex ?? 0 or use "'splitIndex' in
(action.options ?? {})" before accessing), referencing the splitIndex variable
and the action object so the code never accesses action.options when it's
undefined.

In `@packages/desktop-client/src/rules/queries.ts`:
- Around line 6-30: Change ruleQueries' properties (all, lists, list, listPayee)
from arrow functions to method syntax and remove the "as const" assertions:
implement them as methods on the ruleQueries object (e.g., all() { ... },
lists() { ... }) and replace any "as const" queryKey/trailing assertions with a
TypeScript "satisfies" constraint on the ruleQueries object so the returned
queryKey tuples are strongly typed without type assertions; keep the same
queryOptions usage for list and listPayee (including queryFn, staleTime,
enabled) and retain the payeeId runtime guard in listPayee but avoid
non-null/assertion operators. Ensure you reference and update ruleQueries.all,
ruleQueries.lists, ruleQueries.list, and ruleQueries.listPayee when applying
these changes.

---

Duplicate comments:
In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`:
- Around line 114-129: The handleRuleDelete function is marked async and
manually calls refetchRules despite useDeleteRuleMutation already invalidating
queries; remove the unnecessary async keyword, remove the explicit
refetchRules() call inside handleRuleDelete, and update the dependency array for
the useCallback (remove refetchRules) to avoid stale lint warnings; keep
deleteRule, showUndoNotification, and t in the dependency list so
handleRuleDelete remains stable.

---

Nitpick comments:
In `@packages/desktop-client/src/components/ManageRules.tsx`:
- Around line 217-244: The onDeleteSelected and onDeleteRule handlers call
refetchRules() inside their onSuccess callbacks even though batchDeleteRules and
deleteRule mutations already invalidate the rules queries; remove the explicit
void refetchRules() calls from onSuccess in both onDeleteSelected (where
batchDeleteRules is called) and onDeleteRule (where deleteRule is called) so the
query invalidation handles refetching and avoids duplicate fetches, retaining
the selectedInst.dispatch call in onDeleteSelected and keeping onSuccess
otherwise unchanged.
- Around line 129-153: The payee-specific query is running even when payeeId is
null which causes unnecessary requests and makes isLoading reflect payee flags;
update the usePayeeRules call to disable the query when payeeId is falsy (e.g.,
pass an enabled: !!payeeId option) and/or change the isLoading computation to
only include isPayeeRulesLoading and isPayeeRulesRefetching when payeeId is
truthy; adjust refetchRules to keep the existing ternary (refetchPayeeRules vs
refetchAllRules) so behavior stays correct.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx`:
- Around line 966-967: The two helpers getActions and getUnparsedActions are
defined as arrow functions but must be pure helpers declared with the function
keyword; replace the arrow definitions of getActions and getUnparsedActions with
function declarations (keeping the same parameter name splits and behavior that
uses unparseActions and .flatMap) so callers and hoisting behave consistently.
- Around line 1026-1027: The initial pre-split element currently uses a type
assertion ("as") which should be removed; instead construct the initial element
with an explicit shape or use TypeScript's "satisfies" to ensure it matches the
actionSplits item type. Locate the array literal that creates [{ id: uuid(),
actions: [] } as (typeof actionSplits)[0]] and replace the assertion by either
declaring the element with the concrete interface/type used by actionSplits or
append "satisfies (typeof actionSplits)[0]" so the value is type-checked without
an "as" cast (keeping uuid() and actions:[] intact). Ensure imports/types
required for the concrete type are available and adjust the expression
accordingly.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8630a4f and b288ce5.

📒 Files selected for processing (7)
  • packages/desktop-client/src/components/ManageRules.tsx
  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
  • packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
  • packages/desktop-client/src/components/rules/RuleEditor.tsx
  • packages/desktop-client/src/components/transactions/TransactionList.tsx
  • packages/desktop-client/src/rules/mutations.ts
  • packages/desktop-client/src/rules/queries.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-client/src/rules/mutations.ts

@netlify

netlify Bot commented Mar 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for actualbudget-website ready!

Name Link
🔨 Latest commit 51b75df
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget-website/deploys/69b8285e42e92a0008bb1930
😎 Deploy Preview https://deploy-preview-7070.www.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx (1)

115-130: ⚠️ Potential issue | 🟠 Major

Handle non-deleted results explicitly and drop the extra refetch.

At Line 119, onSuccess always shows a success message, but the server delete path can return false (rule not deleted, e.g. linked schedule). Also, Line 124 triggers an extra fetch even though useDeleteRuleMutation already invalidates queries globally.

🔧 Proposed fix
   const handleRuleDelete = useCallback(
     (rule: RuleEntity) => {
       deleteRule(
         { id: rule.id },
         {
-          onSuccess: () => {
-            showUndoNotification({
-              message: t('Rule deleted successfully'),
-            });
-            // Refresh the rules list
-            void refetchRules();
+          onSuccess: wasDeleted => {
+            if (!wasDeleted) {
+              return;
+            }
+            showUndoNotification({
+              message: t('Rule deleted successfully'),
+            });
           },
         },
       );
     },
-    [deleteRule, showUndoNotification, t, refetchRules],
+    [deleteRule, showUndoNotification, t],
   );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`
around lines 115 - 130, The onSuccess handler for deleteRule should check the
mutation result and only show the success/undo notification if the server
actually deleted the rule, and you should remove the redundant explicit
refetchRules call because useDeleteRuleMutation already invalidates queries;
update the anonymous callback passed to deleteRule (the onSuccess in the
deleteRule call) to inspect the response (e.g., a boolean or { deleted } result
returned by the mutation) and conditionally call showUndoNotification, and then
delete the void refetchRules() invocation from that handler.
🧹 Nitpick comments (1)
packages/desktop-client/src/components/rules/RuleEditor.tsx (1)

1025-1025: Replace the as assertion with a satisfies-based initializer

Line 1025 uses as (typeof actionSplits)[0], which is brittle and violates the repo TS rule.

Proposed refactor
-  const [actionSplits, setActionSplits] = useState<
-    Array<{
-      id: string;
-      actions: Array<RuleActionEntity & { inputKey: string }>;
-    }>
-  >(() => {
+  type ActionSplit = {
+    id: string;
+    actions: Array<RuleActionEntity & { inputKey: string }>;
+  };
+  const [actionSplits, setActionSplits] = useState<ActionSplit[]>(() => {
@@
-      [{ id: uuid(), actions: [] } as (typeof actionSplits)[0]],
+      [{ id: uuid(), actions: [] } satisfies ActionSplit],
     );
   });

As per coding guidelines, "Use satisfies instead of type assertions (as, !) in TypeScript".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx` at line 1025,
Replace the brittle type assertion on the array initializer by using
TypeScript's satisfies with the action template: construct the object literal {
id: uuid(), actions: [] } and apply "satisfies (typeof actionSplits)[0]" to that
literal (e.g., wrap the single-item array element with satisfies) instead of
using "as (typeof actionSplits)[0]"; keep the surrounding array and ensure you
reference the existing actionSplits identifier and uuid() call so the shape is
validated without an assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/desktop-client/src/components/rules/RuleEditor.tsx`:
- Around line 1264-1267: In RuleEditor update the call to originalOnSave so the
server-returned id wins: when invoking originalOnSave (the block using
originalOnSave?.({...})) change the object spread order so you spread the
existing rule first and then set id (use {...rule, id}) instead of {id,
...rule}, ensuring the mutation result stored in the id variable cannot be
overwritten by rule.id.
- Around line 1240-1242: The onSuccess callback for applyRuleActions currently
closes over actionSplits and calls setActionSplits([...actionSplits]), risking a
stale update; change this to use the functional updater form (e.g.,
setActionSplits(prev => [...prev])) so the latest state is used when
applyRuleActions resolves, referencing the existing setActionSplits,
actionSplits, and the onSuccess handler around applyRuleActions.
- Around line 1269-1275: The onError callback in RuleEditor uses the 'in'
operator on the unknown error parameter (lines around onError) which can throw
if error is null or a primitive; add a defensive narrow (e.g., check error !==
null && typeof error === 'object') before any 'in' checks, then safely access
error.conditionErrors and error.actionErrors to call
setConditions(applyErrors(...)) and the action error handling (usedErrorIdx
logic); ensure you narrow once at the start of the onError handler so subsequent
references to conditionErrors/actionErrors are type-safe.

---

Duplicate comments:
In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`:
- Around line 115-130: The onSuccess handler for deleteRule should check the
mutation result and only show the success/undo notification if the server
actually deleted the rule, and you should remove the redundant explicit
refetchRules call because useDeleteRuleMutation already invalidates queries;
update the anonymous callback passed to deleteRule (the onSuccess in the
deleteRule call) to inspect the response (e.g., a boolean or { deleted } result
returned by the mutation) and conditionally call showUndoNotification, and then
delete the void refetchRules() invocation from that handler.

---

Nitpick comments:
In `@packages/desktop-client/src/components/rules/RuleEditor.tsx`:
- Line 1025: Replace the brittle type assertion on the array initializer by
using TypeScript's satisfies with the action template: construct the object
literal { id: uuid(), actions: [] } and apply "satisfies (typeof
actionSplits)[0]" to that literal (e.g., wrap the single-item array element with
satisfies) instead of using "as (typeof actionSplits)[0]"; keep the surrounding
array and ensure you reference the existing actionSplits identifier and uuid()
call so the shape is validated without an assertion.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b288ce5 and 8c190dc.

📒 Files selected for processing (2)
  • packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
  • packages/desktop-client/src/components/rules/RuleEditor.tsx

Comment on lines +1240 to +1242
onSuccess: () => {
setActionSplits([...actionSplits]);
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

fd "RuleEditor.tsx" packages/desktop-client

Repository: actualbudget/actual

Length of output: 122


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '1230,1255p'

Repository: actualbudget/actual

Length of output: 915


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '1,100p'

Repository: actualbudget/actual

Length of output: 4216


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '100,300p'

Repository: actualbudget/actual

Length of output: 5678


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '700,900p'

Repository: actualbudget/actual

Length of output: 7156


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '1050,1150p'

Repository: actualbudget/actual

Length of output: 4235


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '1000,1050p'

Repository: actualbudget/actual

Length of output: 2044


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '1230,1280p'

Repository: actualbudget/actual

Length of output: 1737


🏁 Script executed:

rg "useApplyRuleActionsMutation" packages/desktop-client/src/components/rules/RuleEditor.tsx -A 10

Repository: actualbudget/actual

Length of output: 734


🏁 Script executed:

fd "rules.ts" packages/desktop-client/src -type f | head -20

Repository: actualbudget/actual

Length of output: 233


🏁 Script executed:

fd "rules\\.ts" packages/desktop-client/src

Repository: actualbudget/actual

Length of output: 214


🏁 Script executed:

rg "useApplyRuleActionsMutation" packages/desktop-client/src --type ts --type tsx -l

Repository: actualbudget/actual

Length of output: 90


🏁 Script executed:

rg "useApplyRuleActionsMutation" packages/desktop-client/src -l

Repository: actualbudget/actual

Length of output: 169


🏁 Script executed:

cat -n packages/desktop-client/src/rules/mutations.ts

Repository: actualbudget/actual

Length of output: 14005


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '1190,1230p'

Repository: actualbudget/actual

Length of output: 1439


🏁 Script executed:

cat -n packages/desktop-client/src/components/rules/RuleEditor.tsx | sed -n '1115,1165p'

Repository: actualbudget/actual

Length of output: 2281


Use state setter function to avoid stale closure in onSuccess

Line 1241 captures actionSplits in the callback closure. If edits occur while applyRuleActions is in flight, the success callback will restore the stale captured state instead of the current state. Other state updates in this file correctly use functional updates (lines 1193–1225), which should be applied here as well.

Safe state update
-        onSuccess: () => {
-          setActionSplits([...actionSplits]);
-        },
+        onSuccess: () => {
+          setActionSplits(current => [...current]);
+        },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onSuccess: () => {
setActionSplits([...actionSplits]);
},
onSuccess: () => {
setActionSplits(current => [...current]);
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx` around lines
1240 - 1242, The onSuccess callback for applyRuleActions currently closes over
actionSplits and calls setActionSplits([...actionSplits]), risking a stale
update; change this to use the functional updater form (e.g.,
setActionSplits(prev => [...prev])) so the latest state is used when
applyRuleActions resolves, referencing the existing setActionSplits,
actionSplits, and the onSuccess handler around applyRuleActions.

@matt-fidd matt-fidd self-assigned this Mar 11, 2026
@netlify

netlify Bot commented Mar 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for actualbudget-storybook ready!

Name Link
🔨 Latest commit 51b75df
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget-storybook/deploys/69b8285e70266d0008d56dac
😎 Deploy Preview https://deploy-preview-7070--actualbudget-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/desktop-client/src/hooks/usePreviewTransactions.ts (1)

67-87: ⚠️ Potential issue | 🟠 Major

Use a non-invalidating path for preview rule execution.

Line 67 wires preview generation to useRunRulesMutation, and lines 82–86 call it once per preview transaction. The mutation invalidates the rule queries cache on each success (via onSuccess in packages/desktop-client/src/rules/mutations.ts), which is unnecessary overhead for a read-only preview flow. Consider calling send('rules-run', ...) directly or using a mutation without the invalidation side effect.

Additionally, the dependency array at lines 119–125 includes schedules and upcomingLength, which are not used in the effect body itself—only in the useMemo above that computes scheduleTransactions. Remove these redundant dependencies to avoid unnecessary effect reruns.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/hooks/usePreviewTransactions.ts` around lines 67
- 87, The preview effect is calling the invalidating mutation via
useRunRulesMutation (mutateAsync aliased as runRulesAsync) for each
scheduleTransaction, causing unnecessary cache invalidations; change the effect
in usePreviewTransactions to invoke the read-only preview path (e.g., dispatch
send('rules-run', { transaction }) or create/use a non-invalidating mutation
specifically for previews) instead of calling runRulesAsync, and keep all other
logic (isUnmounted, setIsLoading, setPreviewTransactions) unchanged. Also remove
the unused dependencies (schedules and upcomingLength) from the effect's
dependency array—leave only values that the effect actually reads (such as
scheduleTransactions and run/send function references) so the effect doesn't
rerun unnecessarily.
🧹 Nitpick comments (3)
packages/loot-core/src/server/schedules/app.ts (1)

275-281: Prefer immutable normalization for schedule.name.

Current behavior is fine, but mutating schedule in-place is avoidable here.

♻️ Suggested refactor
-  if (schedule.name) {
-    if (await checkIfScheduleExists(schedule.name, scheduleId)) {
+  const normalizedSchedule = {
+    ...schedule,
+    name: schedule.name || null,
+  };
+
+  if (normalizedSchedule.name) {
+    if (await checkIfScheduleExists(normalizedSchedule.name, scheduleId)) {
       throw new Error('Cannot create schedules with the same name');
     }
-  } else {
-    schedule.name = null;
   }
@@
   await db.insertWithSchema('schedules', {
-    ...schedule,
+    ...normalizedSchedule,
     id: scheduleId,
     rule: ruleId,
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/loot-core/src/server/schedules/app.ts` around lines 275 - 281, Avoid
mutating schedule in-place: instead of assigning schedule.name = null, compute a
normalizedName (e.g., const normalizedName = schedule.name ?? null), use
normalizedName when calling checkIfScheduleExists(schedule.name, scheduleId) (or
pass normalizedName) and when constructing any new schedule payload or DB
upsert, and leave the original schedule object untouched; update references in
this block to use normalizedName and keep the rest of the flow (including
throwing via throw new Error('Cannot create schedules with the same name'))
unchanged.
packages/desktop-client/src/hooks/usePreviewTransactions.ts (1)

119-124: Trim redundant effect dependencies.

Line 121 (schedules) and Line 123 (upcomingLength) are not read inside the effect body; scheduleTransactions already captures them. Keeping only values used by the effect will reduce extra reruns.

Suggested diff
   }, [
     scheduleTransactions,
-    schedules,
     statuses,
-    upcomingLength,
     runRulesAsync,
   ]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/hooks/usePreviewTransactions.ts` around lines 119
- 124, The effect in usePreviewTransactions has redundant dependencies—remove
schedules and upcomingLength from the dependency array because
scheduleTransactions already captures those values; update the dependencies to
only include the values actually referenced inside the effect (e.g.,
scheduleTransactions, statuses, runRulesAsync) and ensure scheduleTransactions
is a stable reference (useCallback) if it isn't already so the effect behavior
remains correct.
packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx (1)

692-693: Prefer mutateAsync + await in this confirm flow.

Line 753 uses fire-and-forget mutate inside an async onConfirm handler that already awaits deletion (line 736). Using mutateAsync here keeps the delete → create operation fully sequential and ensures the entire operation completes before the handler returns.

Suggested diff
-    const { mutate: createSingleTimeScheduleFromTransaction } =
+    const { mutateAsync: createSingleTimeScheduleFromTransaction } =
       useCreateSingleTimeScheduleFromTransaction();
...
-                  createSingleTimeScheduleFromTransaction(
-                    {
-                      transaction: transactionForSchedule,
-                    },
-                    {
-                      onSuccess: () => {
-                        dispatch(
-                          addNotification({
-                            notification: {
-                              type: 'message',
-                              message: t('Schedule created successfully'),
-                            },
-                          }),
-                        );
-                        void navigate(-1);
-                      },
-                    },
-                  );
+                  await createSingleTimeScheduleFromTransaction({
+                    transaction: transactionForSchedule,
+                  });
+                  dispatch(
+                    addNotification({
+                      notification: {
+                        type: 'message',
+                        message: t('Schedule created successfully'),
+                      },
+                    }),
+                  );
+                  void navigate(-1);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx`
around lines 692 - 693, The confirm flow currently calls
createSingleTimeScheduleFromTransaction.mutate in a fire-and-forget way; update
the onConfirm async handler to call and await
createSingleTimeScheduleFromTransaction.mutateAsync so the sequence is delete
(already awaited) → create is fully sequential and the handler only returns
after creation completes; adjust any surrounding try/catch or error handling in
the onConfirm handler to handle errors from mutateAsync appropriately.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/desktop-client/src/hooks/usePreviewTransactions.ts`:
- Around line 67-87: The preview effect is calling the invalidating mutation via
useRunRulesMutation (mutateAsync aliased as runRulesAsync) for each
scheduleTransaction, causing unnecessary cache invalidations; change the effect
in usePreviewTransactions to invoke the read-only preview path (e.g., dispatch
send('rules-run', { transaction }) or create/use a non-invalidating mutation
specifically for previews) instead of calling runRulesAsync, and keep all other
logic (isUnmounted, setIsLoading, setPreviewTransactions) unchanged. Also remove
the unused dependencies (schedules and upcomingLength) from the effect's
dependency array—leave only values that the effect actually reads (such as
scheduleTransactions and run/send function references) so the effect doesn't
rerun unnecessarily.

---

Nitpick comments:
In
`@packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx`:
- Around line 692-693: The confirm flow currently calls
createSingleTimeScheduleFromTransaction.mutate in a fire-and-forget way; update
the onConfirm async handler to call and await
createSingleTimeScheduleFromTransaction.mutateAsync so the sequence is delete
(already awaited) → create is fully sequential and the handler only returns
after creation completes; adjust any surrounding try/catch or error handling in
the onConfirm handler to handle errors from mutateAsync appropriately.

In `@packages/desktop-client/src/hooks/usePreviewTransactions.ts`:
- Around line 119-124: The effect in usePreviewTransactions has redundant
dependencies—remove schedules and upcomingLength from the dependency array
because scheduleTransactions already captures those values; update the
dependencies to only include the values actually referenced inside the effect
(e.g., scheduleTransactions, statuses, runRulesAsync) and ensure
scheduleTransactions is a stable reference (useCallback) if it isn't already so
the effect behavior remains correct.

In `@packages/loot-core/src/server/schedules/app.ts`:
- Around line 275-281: Avoid mutating schedule in-place: instead of assigning
schedule.name = null, compute a normalizedName (e.g., const normalizedName =
schedule.name ?? null), use normalizedName when calling
checkIfScheduleExists(schedule.name, scheduleId) (or pass normalizedName) and
when constructing any new schedule payload or DB upsert, and leave the original
schedule object untouched; update references in this block to use normalizedName
and keep the rest of the flow (including throwing via throw new Error('Cannot
create schedules with the same name')) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 12c8bedc-e0c3-4960-ba44-affd29d4eaf7

📥 Commits

Reviewing files that changed from the base of the PR and between 8c190dc and c21f85a.

📒 Files selected for processing (8)
  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
  • packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
  • packages/desktop-client/src/components/modals/ManageRulesModal.tsx
  • packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
  • packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
  • packages/desktop-client/src/hooks/usePreviewTransactions.ts
  • packages/loot-core/src/server/api.ts
  • packages/loot-core/src/server/schedules/app.ts
💤 Files with no reviewable changes (1)
  • packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/desktop-client/src/components/modals/ManageRulesModal.tsx
  • packages/loot-core/src/server/api.ts

@matt-fidd

Copy link
Copy Markdown
Member

@joel-jeremy one more conflict by the look of it. I've done a review and all looks good, so feel free to ping me when you've resolved and I'll stamp it

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (2)
packages/desktop-client/src/components/rules/RuleEditor.tsx (2)

1240-1242: ⚠️ Potential issue | 🟡 Minor

Use functional state update to avoid stale closure.

The onSuccess callback captures actionSplits in its closure. If the user makes edits while applyRuleActions is in flight, the callback will restore the stale captured state instead of the current state.

Proposed fix
         onSuccess: () => {
-          setActionSplits([...actionSplits]);
+          setActionSplits(current => [...current]);
         },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx` around lines
1240 - 1242, The onSuccess callback for applyRuleActions captures actionSplits
in its closure and can restore stale state; change the updater to use a
functional state update so it reads the latest value at call time (i.e., in
onSuccess call setActionSplits with an updater that accepts prev and returns a
new array based on prev). Update the onSuccess handler where applyRuleActions is
used so it references setActionSplits(prev => [...prev]) (or an equivalent
functional updater) instead of setActionSplits([...actionSplits]).

1266-1282: ⚠️ Potential issue | 🟠 Major

Guard error shape before using 'in' checks and use functional state update.

Two issues in the onError handler:

  1. Type safety: The error parameter is unknown. Using 'in' operator on null, undefined, or primitives throws a TypeError. Add a defensive guard at the start.

  2. Stale closure: Line 1274 uses actionSplits from the closure. If edits occur while the mutation is in flight, the error handler will operate on stale state.

Proposed fix
         onError: error => {
+          if (typeof error !== 'object' || error == null) {
+            return;
+          }
+
           if ('conditionErrors' in error && error.conditionErrors) {
             setConditions(applyErrors(conditions, error.conditionErrors));
           }

           if ('actionErrors' in error && error.actionErrors) {
             let usedErrorIdx = 0;
-            setActionSplits(
-              actionSplits.map(item => ({
+            setActionSplits(currentSplits =>
+              currentSplits.map(item => ({
                 ...item,
                 actions: item.actions.map(action => ({
                   ...action,
                   error: error.actionErrors[usedErrorIdx++] ?? null,
                 })),
               })),
             );
           }
         },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/rules/RuleEditor.tsx` around lines
1266 - 1282, The onError handler must first guard the unknown error shape (e.g.,
if (!error || typeof error !== 'object')) before using 'in' so
'conditionErrors'/'actionErrors' checks are safe, and should use functional
state updates to avoid stale closures: call setConditions(prev =>
applyErrors(prev, (error as any).conditionErrors)) only after verifying
Array.isArray((error as any).conditionErrors), and replace the
setActionSplits(actionSplits.map(...)) with setActionSplits(prev => { let
usedErrorIdx = 0; return prev.map(item => ({ ...item, actions:
item.actions.map(action => ({ ...action, error: ((error as any).actionErrors &&
Array.isArray((error as any).actionErrors)) ? ((error as
any).actionErrors[usedErrorIdx++] ?? null) : null })) })); }) so you operate on
the latest state and only index into actionErrors after confirming its array
shape.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/desktop-client/src/components/accounts/Account.tsx`:
- Around line 695-697: The current code calls this.props.onRunRules(transaction)
inside a for loop which triggers useRunRulesMutation().mutateAsync's onSuccess
invalidation for each transaction; change it to batch or defer invalidation by
collecting transactions into an array and calling onRunRules once with the full
array (or add a new batched entrypoint), or call mutateAsync for each but pass
an options object that suppresses per-call invalidation and then perform a
single query invalidation/refetch after the loop; update references to
onRunRules and the useRunRulesMutation().mutateAsync call sites accordingly so
invalidation happens once after all transactions are processed.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`:
- Around line 114-128: The useCallback for handleRuleDelete includes an unused
refetchRules in its dependency array; update the dependency array for the
handleRuleDelete declaration to remove refetchRules so it only depends on
deleteRule, showUndoNotification and t (i.e., ensure handleRuleDelete's
dependency array matches the actual references inside the callback that call
deleteRule and showUndoNotification).

In
`@packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx`:
- Around line 753-770: The modal is closed (state.close()) before the async
onConfirm handler finishes, causing a race with
createSingleTimeScheduleFromTransaction; to fix, make the confirm flow await the
schedule creation: either change createSingleTimeScheduleFromTransaction usage
to call its mutateAsync variant and await it inside the async onConfirm (so the
onSuccess logic and navigate(-1) run deterministically) or make the button
handler async and await onConfirm() before calling state.close(); update
ConvertToScheduleModal's onConfirm/state.close usage and similarly adjust
DiscoverSchedules if present to ensure state.close() happens only after the
awaited mutation completes.

In `@packages/desktop-client/src/components/rules/Value.tsx`:
- Around line 92-125: The switch case blocks for 'payee', 'category',
'category_group', 'account', and 'rule' declare consts (payee, category,
categoryGroup, account) that can leak scope; wrap the body of each of those case
labels in a block (e.g., case 'payee': { ... break; }) so the const declarations
are block-scoped and do not collide across cases, ensuring each case returns as
before and includes the existing valueIsRaw checks and describe/t('(deleted)')
handling.

---

Duplicate comments:
In `@packages/desktop-client/src/components/rules/RuleEditor.tsx`:
- Around line 1240-1242: The onSuccess callback for applyRuleActions captures
actionSplits in its closure and can restore stale state; change the updater to
use a functional state update so it reads the latest value at call time (i.e.,
in onSuccess call setActionSplits with an updater that accepts prev and returns
a new array based on prev). Update the onSuccess handler where applyRuleActions
is used so it references setActionSplits(prev => [...prev]) (or an equivalent
functional updater) instead of setActionSplits([...actionSplits]).
- Around line 1266-1282: The onError handler must first guard the unknown error
shape (e.g., if (!error || typeof error !== 'object')) before using 'in' so
'conditionErrors'/'actionErrors' checks are safe, and should use functional
state updates to avoid stale closures: call setConditions(prev =>
applyErrors(prev, (error as any).conditionErrors)) only after verifying
Array.isArray((error as any).conditionErrors), and replace the
setActionSplits(actionSplits.map(...)) with setActionSplits(prev => { let
usedErrorIdx = 0; return prev.map(item => ({ ...item, actions:
item.actions.map(action => ({ ...action, error: ((error as any).actionErrors &&
Array.isArray((error as any).actionErrors)) ? ((error as
any).actionErrors[usedErrorIdx++] ?? null) : null })) })); }) so you operate on
the latest state and only index into actionErrors after confirming its array
shape.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a54b479b-aeee-4c32-9a93-17b05d244d4f

📥 Commits

Reviewing files that changed from the base of the PR and between 8c190dc and 72be07e.

📒 Files selected for processing (13)
  • packages/desktop-client/src/components/accounts/Account.tsx
  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
  • packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
  • packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
  • packages/desktop-client/src/components/modals/ManageRulesModal.tsx
  • packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
  • packages/desktop-client/src/components/rules/RuleEditor.tsx
  • packages/desktop-client/src/components/rules/Value.tsx
  • packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
  • packages/desktop-client/src/components/transactions/TransactionList.tsx
  • packages/desktop-client/src/hooks/usePreviewTransactions.ts
  • packages/loot-core/src/server/api.ts
  • packages/loot-core/src/server/schedules/app.ts
💤 Files with no reviewable changes (1)
  • packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/desktop-client/src/hooks/usePreviewTransactions.ts
  • packages/desktop-client/src/components/modals/ManageRulesModal.tsx
  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
  • packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx (1)

114-128: Consider removing manual useCallback for handleRuleDelete in desktop-client.

Given the React Compiler guidance for this package, this callback can be a plain function and avoids dependency-array upkeep.

♻️ Proposed simplification
-  const handleRuleDelete = useCallback(
-    (rule: RuleEntity) => {
-      deleteRule(
-        { id: rule.id },
-        {
-          onSuccess: () => {
-            showUndoNotification({
-              message: t('Rule deleted successfully'),
-            });
-          },
-        },
-      );
-    },
-    [deleteRule, showUndoNotification, t],
-  );
+  function handleRuleDelete(rule: RuleEntity) {
+    deleteRule(
+      { id: rule.id },
+      {
+        onSuccess: () => {
+          showUndoNotification({
+            message: t('Rule deleted successfully'),
+          });
+        },
+      },
+    );
+  }

As per coding guidelines, "In desktop-client, the React Compiler automatically memoizes component bodies; omit manual useCallback, useMemo, and React.memo when adding or refactoring code."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`
around lines 114 - 128, Remove the manual useCallback wrapper around
handleRuleDelete: replace the useCallback-wrapped function with a plain function
named handleRuleDelete(rule: RuleEntity) that calls deleteRule({ id: rule.id },
{ onSuccess: () => showUndoNotification({ message: t('Rule deleted
successfully') }) }); remove useCallback import if unused and update the
dependency array usage (deleteRule, showUndoNotification, t) is no longer
needed; keep the function name handleRuleDelete and ensure any callers still
reference it unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx`:
- Around line 114-128: Remove the manual useCallback wrapper around
handleRuleDelete: replace the useCallback-wrapped function with a plain function
named handleRuleDelete(rule: RuleEntity) that calls deleteRule({ id: rule.id },
{ onSuccess: () => showUndoNotification({ message: t('Rule deleted
successfully') }) }); remove useCallback import if unused and update the
dependency array usage (deleteRule, showUndoNotification, t) is no longer
needed; keep the function name handleRuleDelete and ensure any callers still
reference it unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 624d3f9b-5280-4f6b-bbe6-923d2d7eedcd

📥 Commits

Reviewing files that changed from the base of the PR and between 72be07e and 4fae08e.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the Stale label May 6, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 5 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants