[PR #3641] [MERGED] Clarify logic to generate splits from rules #4975

Closed
opened 2026-02-28 21:04:05 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3641
Author: @jfdoming
Created: 10/12/2024
Status: Merged
Merged: 10/19/2024
Merged by: @jfdoming

Base: masterHead: jfdoming/clarify-logic-to-generate-splits


📝 Commits (5)

  • 395221c Add tests for bug
  • 6c50125 Add tests for unexpected behaviour
  • bbe5c8c Refactor to consistently generate valid splits with no errors
  • c657e7a Add release notes
  • bdeb3cb Update test names

📊 Changes

3 files changed (+267 additions, -112 deletions)

View changed files

📝 packages/loot-core/src/server/accounts/rules.test.ts (+187 -0)
📝 packages/loot-core/src/server/accounts/rules.ts (+74 -112)
upcoming-release-notes/3641.md (+6 -0)

📄 Description

Closes #3353 and fixes another bug I found in the process (if you add amounts that don't add up to the total, previously there was no error). Process I used to test this:

  1. Add unit tests for #3353 and validate the specific test fails.
  2. Add tests for the other bug and validate they fail.
  3. Refactor and simplify the split generation logic. All tests now pass, and some basic testing in the UI looks good.

The straightforward fix for this issue is in https://github.com/actualbudget/actual/pull/3624. However, from revisiting this logic, it was pretty messy and hard to reason about before. Hopefully the refactor I'm landing here along with the tests will give increased confidence.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/3641 **Author:** [@jfdoming](https://github.com/jfdoming) **Created:** 10/12/2024 **Status:** ✅ Merged **Merged:** 10/19/2024 **Merged by:** [@jfdoming](https://github.com/jfdoming) **Base:** `master` ← **Head:** `jfdoming/clarify-logic-to-generate-splits` --- ### 📝 Commits (5) - [`395221c`](https://github.com/actualbudget/actual/commit/395221c26a8983979549e85f4debb69fbd390edb) Add tests for bug - [`6c50125`](https://github.com/actualbudget/actual/commit/6c501252ba2858af5751237afd967e832780b956) Add tests for unexpected behaviour - [`bbe5c8c`](https://github.com/actualbudget/actual/commit/bbe5c8c061cdc127020afafacf0f64379d4c4a60) Refactor to consistently generate valid splits with no errors - [`c657e7a`](https://github.com/actualbudget/actual/commit/c657e7a1d9ca34c729111d1539e57565062b8230) Add release notes - [`bdeb3cb`](https://github.com/actualbudget/actual/commit/bdeb3cb859a1c60519ad046e6003674e8634f651) Update test names ### 📊 Changes **3 files changed** (+267 additions, -112 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/accounts/rules.test.ts` (+187 -0) 📝 `packages/loot-core/src/server/accounts/rules.ts` (+74 -112) ➕ `upcoming-release-notes/3641.md` (+6 -0) </details> ### 📄 Description Closes #3353 and fixes another bug I found in the process (if you add amounts that _don't_ add up to the total, previously there _was no error_). Process I used to test this: 1. Add unit tests for #3353 and validate the specific test fails. 2. Add tests for the other bug and validate they fail. 3. Refactor and simplify the split generation logic. All tests now pass, and some basic testing in the UI looks good. The straightforward fix for this issue is in https://github.com/actualbudget/actual/pull/3624. However, from revisiting this logic, it was pretty messy and hard to reason about before. Hopefully the refactor I'm landing here along with the tests will give increased confidence. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:04:05 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4975