Repository navigation
Count /schedule edit timing from the edit; refuse dead one-offs - #141
Merged
Merged
Conversation
A timing edit (when, repeat or days) kept the old lastRunAt, so the runner could post an occurrence of the new timing that fell up to an hour before the edit, right away, while the reply said the next one. Moving the time now sets lastRunAt to max(stored, now), as resume already does. An edit that turns a repeat into a one-off whose start has passed, and a resume of a one-off whose time passed while paused, are now refused with a clear message instead of keeping a schedule that can never post. The `when` option description names the configured PIXEL_TIMEZONE instead of a hard-coded Europe/Amsterdam. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
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.
What was wrong
/schedule edit days:thu(nowhen).startandlastRunAtstayed the same, so the runner's next occurrence afterlastRunAtwas Thu 15 Oct 19:00. That was only 20 minutes late, under the one-hour limit, so it posted on the next tick. The "✅ Updated" reply counts from now, so it said Thu 22 Oct. Changing weekly to monthly had the same problem./schedule resumeon a one-off whose time passed while it was paused replied "it has no more posts to make" but kept it./schedule edit repeat:oncewith nowhenon a weekly schedule left a past start ("Next posts: None").whenoption description always said "Europe/Amsterdam", even though the zone actually used comes fromPIXEL_TIMEZONE.What changed (
src/features/schedules/index.tsonly)startorrecurrence, it now setslastRunAtto max(stored, now), the same ruleresumealready used (now shared in afromNowhelper). Edits that leave the timing alone (text, name, or a repeat/days identical to what's stored) don't touchlastRunAt.when…".resumerefuses a one-off that has nothing left to post, says to use/schedule delete, and leaves it paused.just registerbefore Discord shows the new text. With Europe/Amsterdam the text is unchanged. (just registerwas not run.)Docs (
docs/commands.md,docs/architecture.md) and the CHANGELOG (Fixed) are updated.Not covered here
A one-off the runner auto-pauses because its creator lost access (
paused_no_access) is still kept until someone deletes it. It shows as paused in/schedule list, andresumenow refuses it with the delete hint. Removing these automatically would mean changingrunner.ts, which is being changed in another PR, so I left it alone.Testing
schedules.test.tsuse a fakeCommandContextthrough the dispatcher, a settable clock, and a single runner tick throughfeature.start():lastRunAtrepeat:oncewith nowhenis refused by both the form and the command, and works withwhenwhendescription names a non-Amsterdam zonelastRunAtassertion removed, the edit tests show the post really going out right away.just checkpasses.No file listed in AGENTS.md rule 14 is touched.
🤖 Generated with Claude Code