[PR #1917] [MERGED] [Bugfix] Goals: Fix Schedule Infinite loop #4020

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1917
Author: @shall0pass
Created: 11/16/2023
Status: Merged
Merged: 11/17/2023
Merged by: @shall0pass

Base: masterHead: goals_schedul1913


📝 Commits (2)

📊 Changes

3 files changed (+25 additions, -0 deletions)

View changed files

📝 packages/loot-core/src/server/budget/goals/goalsSchedule.ts (+12 -0)
📝 packages/loot-core/src/shared/months.ts (+7 -0)
upcoming-release-notes/1917.md (+6 -0)

📄 Description

Resolves #1913

When the next_date loop is executed, it is iterated in 1 day increments looking for a 'next schedule'. What was happening was the loop had a current date that occurred on a weekend and when we went to get the next occurrence (which should land on the weekend) it was returning that occurrence 1 day before. So each time the loop was set back 1 day before adding the 1 day and we had an infinite loop condition. I've added a check to look for how many days difference the current date and the next date are, and if that value is 0, it will add 3 days instead of 1. I used 3 to resolve the same situation had the schedule landed on a Sunday.


🔄 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/1917 **Author:** [@shall0pass](https://github.com/shall0pass) **Created:** 11/16/2023 **Status:** ✅ Merged **Merged:** 11/17/2023 **Merged by:** [@shall0pass](https://github.com/shall0pass) **Base:** `master` ← **Head:** `goals_schedul1913` --- ### 📝 Commits (2) - [`c748c89`](https://github.com/actualbudget/actual/commit/c748c89d77bc2c474c4977152f83009e8e4f7d39) logic - [`b7a5633`](https://github.com/actualbudget/actual/commit/b7a56333ac87ce01de1ac19a04240107a5ca5497) release note ### 📊 Changes **3 files changed** (+25 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/budget/goals/goalsSchedule.ts` (+12 -0) 📝 `packages/loot-core/src/shared/months.ts` (+7 -0) ➕ `upcoming-release-notes/1917.md` (+6 -0) </details> ### 📄 Description Resolves #1913 When the next_date loop is executed, it is iterated in 1 day increments looking for a 'next schedule'. What was happening was the loop had a current date that occurred on a weekend and when we went to get the next occurrence (which should land on the weekend) it was returning that occurrence 1 day before. So each time the loop was set back 1 day before adding the 1 day and we had an infinite loop condition. I've added a check to look for how many days difference the current date and the next date are, and if that value is 0, it will add 3 days instead of 1. I used 3 to resolve the same situation had the schedule landed on a Sunday. --- <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 20:50:22 -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#4020