[PR #8029] [MERGED] [AI] Skip posted schedule occurrences in balance forecast #126994

Closed
opened 2026-06-14 06:29:46 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/8029
Author: @samaluk
Created: 6/1/2026
Status: Merged
Merged: 6/8/2026
Merged by: @matt-fidd

Base: masterHead: fix/forecast-skip-posted-schedules


📝 Commits (6)

  • 4ce105c [AI] Extract schedule occurrence match start date helper
  • b4bb824 [AI] Add schedule occurrence posted matching helpers
  • 1f7a1b8 [AI] Skip posted schedule occurrences in balance forecast
  • be27f93 [AI] Add release notes for balance forecast schedule dedup fix
  • 4b36495 [AI] Treat op is schedule dates as exact match start
  • 58e1360 [AI] Add daily recurring forecast dedup regression test

📊 Changes

6 files changed (+412 additions, -17 deletions)

View changed files

📝 packages/loot-core/src/server/forecast/app.test.ts (+133 -0)
📝 packages/loot-core/src/server/forecast/app.ts (+1 -0)
📝 packages/loot-core/src/server/forecast/forecast-schedules.ts (+24 -6)
📝 packages/loot-core/src/shared/schedules.test.ts (+164 -1)
📝 packages/loot-core/src/shared/schedules.ts (+84 -10)
upcoming-release-notes/8029.md (+6 -0)

📄 Description

Summary

  • Adds shared helpers to detect when a schedule occurrence is already satisfied by a posted transaction, using the same date-matching rules as the schedules UI.
  • Skips simulated schedule occurrences in the Balance Forecast when a matching posted transaction exists, fixing double-counting when salary (or other schedules) are posted on the due date.
  • Adds regression tests for same-day posting and early payment within the 2-day lookback window.

Fixes the issue reported in https://github.com/actualbudget/actual/issues/7669#issuecomment-4578985011

Test plan

  • yarn workspace @actual-app/core run test -- forecast schedules.test
  • yarn typecheck
  • yarn lint:fix

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 37 14.13 MB → 14.13 MB (+1.86 kB) +0.01%
loot-core 1 5.28 MB → 5.28 MB (+1.48 kB) +0.03%
api 2 3.87 MB → 3.87 MB (+1.44 kB) +0.04%
cli 1 7.97 MB 0%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
37 14.13 MB → 14.13 MB (+1.86 kB) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/schedules.ts 📈 +428 B (+5.80%) 7.21 kB → 7.63 kB
locale/de.json 📈 +1.44 kB (+0.84%) 172.1 kB → 173.54 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/de.js 172.1 kB → 173.54 kB (+1.44 kB) +0.84%
static/js/Value.js 5.08 MB → 5.08 MB (+428 B) +0.01%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 1.6 MB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 962.55 kB 0%
static/js/ManageRules.js 46.63 kB 0%
static/js/PayeeRuleCountLabel.js 7.33 kB 0%
static/js/ReportRouter.js 1.27 MB 0%
static/js/ScheduleEditForm.js 146.57 kB 0%
static/js/SchedulesTable.js 206.26 kB 0%
static/js/TransactionEdit.js 90.63 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/_baseIsEqual.js 98.38 kB 0%
static/js/ca.js 185.63 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 100.19 kB 0%
static/js/en-GB.js 9.25 kB 0%
static/js/en.js 201.61 kB 0%
static/js/es.js 177.58 kB 0%
static/js/extends.js 508.79 kB 0%
static/js/fr.js 177.35 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 163.93 kB 0%
static/js/narrow.js 365.05 kB 0%
static/js/nb-NO.js 147.07 kB 0%
static/js/nl.js 119.71 kB 0%
static/js/pt-BR.js 187.34 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 173.33 kB 0%
static/js/theme.js 31.88 kB 0%
static/js/toString.js 705.14 kB 0%
static/js/uk.js 216.7 kB 0%
static/js/useFormatList.js 2.52 kB 0%
static/js/useTransactionBatchActions.js 9.71 kB 0%
static/js/wide.js 298.88 kB 0%
static/js/workbox-window.prod.es5.js 7.33 kB 0%
static/js/zh-Hans.js 116.44 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.28 MB → 5.28 MB (+1.48 kB) +0.03%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/schedules.ts 📈 +1.12 kB (+20.84%) 5.39 kB → 6.51 kB
home/runner/work/actual/actual/packages/loot-core/src/server/forecast/forecast-schedules.ts 📈 +347 B (+5.57%) 6.08 kB → 6.42 kB
home/runner/work/actual/actual/packages/loot-core/src/server/forecast/app.ts 📈 +14 B (+0.57%) 2.4 kB → 2.41 kB
View detailed bundle breakdown

Added

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

Removed

Asset File Size % Changed
kcab.worker.COd5U_ND.js 5.28 MB → 0 B (-5.28 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
2 3.87 MB → 3.87 MB (+1.44 kB) +0.04%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/schedules.ts 📈 +1.1 kB (+20.86%) 5.26 kB → 6.36 kB
home/runner/work/actual/actual/packages/loot-core/src/server/forecast/forecast-schedules.ts 📈 +341 B (+5.60%) 5.95 kB → 6.28 kB
home/runner/work/actual/actual/packages/loot-core/src/server/forecast/app.ts 📈 +14 B (+0.58%) 2.34 kB → 2.36 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.87 MB → 3.87 MB (+1.44 kB) +0.04%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 7.97 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
cli.js 7.97 MB 0%

crdt

Total

Files count Total bundle size % Changed
1 11.12 kB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
index.js 11.12 kB 0%

🔄 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/8029 **Author:** [@samaluk](https://github.com/samaluk) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/8/2026 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `fix/forecast-skip-posted-schedules` --- ### 📝 Commits (6) - [`4ce105c`](https://github.com/actualbudget/actual/commit/4ce105c244ae04a185c02d442d545606a5d5ed89) [AI] Extract schedule occurrence match start date helper - [`b4bb824`](https://github.com/actualbudget/actual/commit/b4bb8247621fcd0baa063647c6c367a2e073c9b0) [AI] Add schedule occurrence posted matching helpers - [`1f7a1b8`](https://github.com/actualbudget/actual/commit/1f7a1b83fef98dda0ffbea0181d9fd85510d12d5) [AI] Skip posted schedule occurrences in balance forecast - [`be27f93`](https://github.com/actualbudget/actual/commit/be27f931666623669071c4a0869d45a3355ec268) [AI] Add release notes for balance forecast schedule dedup fix - [`4b36495`](https://github.com/actualbudget/actual/commit/4b3649570649f71c23f3d2f165f32b11ea8442bb) [AI] Treat op is schedule dates as exact match start - [`58e1360`](https://github.com/actualbudget/actual/commit/58e1360e45bfe5cf2eab6fdc5769abb6e573fa2b) [AI] Add daily recurring forecast dedup regression test ### 📊 Changes **6 files changed** (+412 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/forecast/app.test.ts` (+133 -0) 📝 `packages/loot-core/src/server/forecast/app.ts` (+1 -0) 📝 `packages/loot-core/src/server/forecast/forecast-schedules.ts` (+24 -6) 📝 `packages/loot-core/src/shared/schedules.test.ts` (+164 -1) 📝 `packages/loot-core/src/shared/schedules.ts` (+84 -10) ➕ `upcoming-release-notes/8029.md` (+6 -0) </details> ### 📄 Description ## Summary - Adds shared helpers to detect when a schedule occurrence is already satisfied by a posted transaction, using the same date-matching rules as the schedules UI. - Skips simulated schedule occurrences in the Balance Forecast when a matching posted transaction exists, fixing double-counting when salary (or other schedules) are posted on the due date. - Adds regression tests for same-day posting and early payment within the 2-day lookback window. Fixes the issue reported in https://github.com/actualbudget/actual/issues/7669#issuecomment-4578985011 ## Test plan - [x] `yarn workspace @actual-app/core run test -- forecast schedules.test` - [x] `yarn typecheck` - [x] `yarn lint:fix` <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 37 | 14.13 MB → 14.13 MB (+1.86 kB) | +0.01% loot-core | 1 | 5.28 MB → 5.28 MB (+1.48 kB) | +0.03% api | 2 | 3.87 MB → 3.87 MB (+1.44 kB) | +0.04% cli | 1 | 7.97 MB | 0% crdt | 1 | 11.12 kB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 37 | 14.13 MB → 14.13 MB (+1.86 kB) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/shared/schedules.ts` | 📈 +428 B (+5.80%) | 7.21 kB → 7.63 kB `locale/de.json` | 📈 +1.44 kB (+0.84%) | 172.1 kB → 173.54 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/de.js | 172.1 kB → 173.54 kB (+1.44 kB) | +0.84% static/js/Value.js | 5.08 MB → 5.08 MB (+428 B) | +0.01% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 1.6 MB | 0% static/js/BackgroundImage.js | 121.09 kB | 0% static/js/FormulaEditor.js | 962.55 kB | 0% static/js/ManageRules.js | 46.63 kB | 0% static/js/PayeeRuleCountLabel.js | 7.33 kB | 0% static/js/ReportRouter.js | 1.27 MB | 0% static/js/ScheduleEditForm.js | 146.57 kB | 0% static/js/SchedulesTable.js | 206.26 kB | 0% static/js/TransactionEdit.js | 90.63 kB | 0% static/js/TransactionList.js | 85.81 kB | 0% static/js/_baseIsEqual.js | 98.38 kB | 0% static/js/ca.js | 185.63 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 100.19 kB | 0% static/js/en-GB.js | 9.25 kB | 0% static/js/en.js | 201.61 kB | 0% static/js/es.js | 177.58 kB | 0% static/js/extends.js | 508.79 kB | 0% static/js/fr.js | 177.35 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 163.93 kB | 0% static/js/narrow.js | 365.05 kB | 0% static/js/nb-NO.js | 147.07 kB | 0% static/js/nl.js | 119.71 kB | 0% static/js/pt-BR.js | 187.34 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 173.33 kB | 0% static/js/theme.js | 31.88 kB | 0% static/js/toString.js | 705.14 kB | 0% static/js/uk.js | 216.7 kB | 0% static/js/useFormatList.js | 2.52 kB | 0% static/js/useTransactionBatchActions.js | 9.71 kB | 0% static/js/wide.js | 298.88 kB | 0% static/js/workbox-window.prod.es5.js | 7.33 kB | 0% static/js/zh-Hans.js | 116.44 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.28 MB → 5.28 MB (+1.48 kB) | +0.03% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/shared/schedules.ts` | 📈 +1.12 kB (+20.84%) | 5.39 kB → 6.51 kB `home/runner/work/actual/actual/packages/loot-core/src/server/forecast/forecast-schedules.ts` | 📈 +347 B (+5.57%) | 6.08 kB → 6.42 kB `home/runner/work/actual/actual/packages/loot-core/src/server/forecast/app.ts` | 📈 +14 B (+0.57%) | 2.4 kB → 2.41 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.BuloPXUY.js | 0 B → 5.28 MB (+5.28 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.COd5U_ND.js | 5.28 MB → 0 B (-5.28 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 2 | 3.87 MB → 3.87 MB (+1.44 kB) | +0.04% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/shared/schedules.ts` | 📈 +1.1 kB (+20.86%) | 5.26 kB → 6.36 kB `home/runner/work/actual/actual/packages/loot-core/src/server/forecast/forecast-schedules.ts` | 📈 +341 B (+5.60%) | 5.95 kB → 6.28 kB `home/runner/work/actual/actual/packages/loot-core/src/server/forecast/app.ts` | 📈 +14 B (+0.58%) | 2.34 kB → 2.36 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- index.js | 3.87 MB → 3.87 MB (+1.44 kB) | +0.04% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- models.js | 0 B | 0% </div> </details> --- #### cli **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 7.97 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- cli.js | 7.97 MB | 0% </div> </details> --- #### crdt **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 11.12 kB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- index.js | 11.12 kB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <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-06-14 06:29:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#126994