[PR #5414] [MERGED] Schedules with the same amount and date are now handled properly #5921

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5414
Author: @Triscal
Created: 7/28/2025
Status: Merged
Merged: 9/17/2025
Merged by: @youngcw

Base: masterHead: schedule-matching-improvements


📝 Commits (10+)

📊 Changes

32 files changed (+132 additions, -2 deletions)

View changed files

📝 packages/desktop-client/e2e/schedules.test.ts (+66 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-full-list-of-schedules-1-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-full-list-of-schedules-2-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-full-list-of-schedules-3-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-13-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-14-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-15-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-1-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-10-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-11-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-12-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-13-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-14-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-15-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-16-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-17-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-18-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-19-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-2-chromium-linux.png (+0 -0)
packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-20-chromium-linux.png (+0 -0)

...and 12 more files

📄 Description

Reproduction steps for bug:

  1. Create two schedules each on the same day, with the same payee and the same amount within the same account.
  2. Try to post both transactions/schedules.

Alternative reproduction steps:

  1. Create two schedules each on the same day, with the same payee and the same amount within the same account.
  2. Add a rule to each schedule that adds a different note.
  3. View the pending transactions in the account list.

On this branch you will not be able to reproduce the bug.

Partially handles: https://github.com/actualbudget/actual/issues/5296

Essentially the issue ended up being that all rules were run on both transactions, this would mean that because the account, payee, date, and amount are the same. Then both transactions were believed to be the same one.

We set a schedule ID on those transactions, so I pulled in that schedule and then rule associated with it and only ran that rule. If there is no schedule associated, the old behaviour is retained.

I also added a test to prevent regressions.

This does leave some questions:

  • Should a transaction created by a schedule only have that schedules rule run on it?
  • Should a rule that is linked to a schedule only run on transactions linked to that schedule?

The answer to the first question is:

  • Any rules associated with other schedules will not be run.
  • Rules that are not associated with any schedules will be run.

The answer to the other question is not determined / impacted by this code. I think this is the right choice right now, if a user manually enters a transaction we do not currently have a way to tell which rule / schedule they want to apply to it. We could add some UI in the future to allow a user to choose, but that's out of scope right now.


🔄 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/5414 **Author:** [@Triscal](https://github.com/Triscal) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 9/17/2025 **Merged by:** [@youngcw](https://github.com/youngcw) **Base:** `master` ← **Head:** `schedule-matching-improvements` --- ### 📝 Commits (10+) - [`dad5f55`](https://github.com/actualbudget/actual/commit/dad5f5575207c315fd778e7aa3e7674bbbfed0aa) minor typescript updates - [`407672a`](https://github.com/actualbudget/actual/commit/407672ad408cbf33ecf34a5f354d9172fa2d20a3) [autofix.ci] apply automated fixes - [`ca89d8c`](https://github.com/actualbudget/actual/commit/ca89d8c229175b792b97cf3d52b625348fa4b2c5) more typescript changes - [`f85ec57`](https://github.com/actualbudget/actual/commit/f85ec5773a3820b9eda395d941478a4c8cd055f7) Merge branch 'schedule-matching-improvements' of https://github.com/Triscal/actual-josh-dev into schedule-matching-improvements - [`10782c3`](https://github.com/actualbudget/actual/commit/10782c3f26ddd911e201f910ce0d380f21169dd7) [autofix.ci] apply automated fixes - [`597d93d`](https://github.com/actualbudget/actual/commit/597d93d1824d06f93c79a6e6c9a8663cbc31b4c1) Another typescript - [`e8d1a33`](https://github.com/actualbudget/actual/commit/e8d1a3382f03af6abd5cd7b9cceaaf22468ca2fd) Merge branch 'schedule-matching-improvements' of https://github.com/Triscal/actual-josh-dev into schedule-matching-improvements - [`4df4c63`](https://github.com/actualbudget/actual/commit/4df4c63848da8352ea04b359d45613162c4c5750) fixes - [`3e246b2`](https://github.com/actualbudget/actual/commit/3e246b21de84bdb276efb7aacfc207af01468025) [autofix.ci] apply automated fixes - [`e22570a`](https://github.com/actualbudget/actual/commit/e22570ad0b8a0961e7ed426e05e7e8d5d71ef8e3) fixed test ### 📊 Changes **32 files changed** (+132 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/e2e/schedules.test.ts` (+66 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-full-list-of-schedules-1-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-full-list-of-schedules-2-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-full-list-of-schedules-3-chromium-linux.png` (+0 -0) ➖ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-13-chromium-linux.png` (+0 -0) ➖ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-14-chromium-linux.png` (+0 -0) ➖ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-15-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-1-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-10-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-11-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-12-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-13-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-14-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-15-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-16-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-17-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-18-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-19-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-2-chromium-linux.png` (+0 -0) ➕ `packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-two-new-schedules-posts-both-transactions-and-later-completes-one-20-chromium-linux.png` (+0 -0) _...and 12 more files_ </details> ### 📄 Description Reproduction steps for [bug](https://github.com/actualbudget/actual/issues/5296): 1. Create two schedules each on the same day, with the same payee and the same amount within the same account. 3. Try to post both transactions/schedules. Alternative reproduction steps: 1. Create two schedules each on the same day, with the same payee and the same amount within the same account. 2. Add a rule to each schedule that adds a different note. 3. View the pending transactions in the account list. On this branch you will not be able to reproduce the bug. <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> Partially handles: https://github.com/actualbudget/actual/issues/5296 Essentially the issue ended up being that all rules were run on both transactions, this would mean that because the account, payee, date, and amount are the same. Then both transactions were believed to be the same one. We set a schedule ID on those transactions, so I pulled in that schedule and then rule associated with it and only ran that rule. If there is no schedule associated, the old behaviour is retained. I also added a test to prevent regressions. This does leave some questions: - Should a transaction created by a schedule only have that schedules rule run on it? - Should a rule that is linked to a schedule only run on transactions linked to that schedule? The answer to the first question is: - Any rules associated with other schedules will **not** be run. - Rules that are not associated with any schedules **will** be run. The answer to the other question is not determined / impacted by this code. I think this is the right choice right now, if a user manually enters a transaction we do not currently have a way to tell which rule / schedule they want to apply to it. We could add some UI in the future to allow a user to choose, but that's out of scope right now. --- <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:20:58 -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#5921