Fix schedule yesterday-branch endTime typo (closes #1190)#1191
Open
pawmmm wants to merge 1 commit into
Open
Conversation
In ScheduleTime.calcScheduleDate, the "still running from yesterday" branch assigned times.endTime = ytimes.startTime instead of ytimes.endTime. The resulting zero-duration window in the past made _calcShouldBeOn return false for any schedule whose current run window crossed local midnight, until tm finally entered today's ttimes. The today-branch (line 1301) and tomorrow-branch (line 1331) already use *.endTime correctly; only the yesterday-branch was wrong. Fixes tagyoureit#1190
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
controller/State.ts:1312— the "still running from yesterday" branch ofScheduleTime.calcScheduleDatewas assigningtimes.endTime = ytimes.startTimeinstead ofytimes.endTime.That single typo collapsed the synthesized live window to a zero-duration point in the past, which made
_calcShouldBeOnreturnfalsewhenever a schedule's window crossed local midnight and the current time was before today'sttimes.startTime.The today-branch (line 1301:
times.endTime = ttimes.endTime) and tomorrow-branch (line 1331:times.endTime = ntimes.endTime) were already correct; only the yesterday-branch was wrong. The fix copies that pattern.Reference issue
Closes #1190 — full trace is in the issue. Short version: a
12:00 PM → 12:00 PMschedule shows greyed/inactive in dashPanel from midnight until noon on the following day, because every AM evaluation lands in the yesterday-branch and gets the broken endTime back.Test plan
tsc --noEmitpasses (baseline was clean, diff still clean).12:00 PM → 12:00 PMon a feature, wait through midnight, confirm dashPanel shows it active in the AM hours of the following day.12:00 AM → 12:00 AMand12:00 PM → 12:00 PM) on the same circuit and confirm both show active in their respective windows after a midnight rollover.Risk
Localized to a single line in a branch that was already returning a degenerate window. No callers depend on the old (broken) value.