Skip to content

[AI] Port upstream schedule and rule fixes - #215

Merged
chrisvasz merged 10 commits into
masterfrom
claude/port-upstream-schedule-rule-fixes
Nov 29, 2026
Merged

chrisvasz merged 10 commits into
masterfrom
claude/port-upstream-schedule-rule-fixes

Conversation

@chrisvasz

Copy link
Copy Markdown
Owner

Ports upstream schedule and rule fixes as cherry-picks (upstream authorship kept), plus one commit adapting them to the fork's synchronous reads.

Ported

Adapted

Skipped

The last commit drops awaits on calls that are synchronous here (runRules, getSchedule, aqlQuery, rule/transaction inserts) so await-thenable lint passes. yarn typecheck and yarn lint pass, as do the loot-core schedules, transactions and sqlite (node + web) tests and the desktop-client applyRulesToTransaction, table/utils, schedule-actions and PayeeAutocomplete tests.

🤖 Generated with Claude Code

galshir and others added 10 commits November 28, 2026 20:18
…951)

* [AI] fix(schedules): allow auto-posting to run again the same day

advanceSchedulesService is throttled to one run per calendar day through the lastScheduleRun pref, so a schedule that starts posting transactions after that run could not post until the next day. Clear the marker whenever such a schedule is created or updated.

* [AI] test(schedules): cover the auto-posting marker reset

* [AI] chore: add release note

* [AI] fix(schedules): type the shared test date condition as const

Without the assertion the shared object literal widens op/field to string, so it is not assignable to RuleConditionEntity and typecheck (and every build that runs tsc) fails.

* [AI] test(schedules): cover the persisted posts_transaction fallback

The existing omitted-field test creates a schedule that does not post transactions, so it only proves the no-reset branch. This one updates a schedule that already posts transactions without repeating the field, which is the case that has to fall back to the stored value before the marker is cleared.
…(#9191)

* [AI] Keep a weekend date moved onto today or later as a schedule's next date

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PvVofKtxTWe228iQ8r1xiD

* [AI] Use the local day when creating a schedule west of UTC

`new Date(currentDay())` parses the day as UTC midnight, which is still
the previous day west of UTC, so a past occurrence could become the
next date. Parse it as a local date instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EogsQHZizXa8kotaRRQXVf

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…ounts (#9205)

* fix: preserve category when making transfer between on/off-budget accounts

The batch "Make transfer" action unconditionally cleared the category.
Now it only clears when both accounts share the same budget type,
matching the server-side clearCategory logic.

Fixes #9200

* fix: resolve TS7006 implicit any in account lookup

Add explicit type annotations to the accounts.find callbacks.

* [autofix.ci] apply automated fixes

* Add release note for #9205

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…ons (#8792)

* [AI] Keep explicitly cleared fields empty when entering new transactions

Rules re-run on every field commit while a new transaction is being
entered, and they are allowed to fill any empty field. A field the user
deliberately cleared (e.g. a category pre-assigned from the payee) was
treated as empty too, so the rule immediately re-filled it - either on
the clear itself or on a later run triggered by editing another field
such as the amount.

Track which fields the user explicitly emptied for the lifetime of the
new-transaction row (desktop register) or edit screen (mobile), and bar
rule runs from re-filling those fields until the row is added or reset.
Auto-fill for untouched fields and notes append/prepend rules keep
working as before.

Fixes the desktop half of #7390; the mobile modal was fixed in #7521.

Co-Authored-By: Claude Fable 5 <[email protected]>

* [AI] Keep cleared fields blocked during mobile payee rule runs

The payee exception in the mobile transaction edit bypassed
shouldApplyRuleChange entirely, so selecting a payee could re-fill a
field the user had explicitly cleared. Check the cleared-field set
before the payee exception, matching the desktop behavior.

Addresses CodeRabbit review feedback on #8792.

Co-Authored-By: Claude Fable 5 <[email protected]>

* [AI] Track cleared fields per transaction row

Review feedback on the cleared-fields tracking: the fields were stored
by name only, shared across the parent and all split rows, so clearing
e.g. the category on one split row stopped rules from filling the
category on its siblings too.

Track cleared fields in a Map keyed by transaction id on both the
desktop register and the mobile transaction edit screen. The rules
merge is extracted into a pure applyRulesToTransaction() helper with
unit tests covering the split scenarios, and split propagation now
skips only rows whose field the user actually cleared instead of
inferring a clear from the parent's (always empty) field value.

Co-Authored-By: Claude Fable 5 <[email protected]>

* [AI] Share split propagation between desktop and mobile rule merges

The mobile transaction edit screen kept its own copy of the
parent-to-subtransaction propagation step. Extract it into an exported
propagateRuleChangeToSubtransactions() helper and call it from both
paths so the two cannot drift apart. The mobile payee override is
unchanged.

Addresses CodeRabbit review feedback on #8792.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: bsmarsh333 <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
…(#9238)

The SQLite REGEXP function built the pattern with new RegExp() unguarded,
so a "matches" rule condition that is still being typed (e.g. "asdf\")
made the rule editor preview query throw and show an error. It now
returns no match for an invalid pattern, the same as matches conditions
evaluated in memory. The web and Electron databases share the helper.

Fixes #6317
runRules, getSchedule, aqlQuery and the rule/transaction inserts are
synchronous in this fork, so drop the awaits the upstream code and tests
used, and keep oxfmt happy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Assigning undefined to process.env.TZ stores the string "undefined",
which runs every later test in the file in UTC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chrisvasz
chrisvasz force-pushed the claude/port-upstream-schedule-rule-fixes branch from 8b779f5 to 809ddeb Compare November 29, 2026 02:18
@chrisvasz
chrisvasz merged commit b541994 into master Nov 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants