Repository navigation
Preserve schedule timing across reloads and timezone changes - #25
Merged
Merged
Conversation
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.
RRULE schedules without
DTSTARTget a new default start each time the underlying library reconstructs the rule. This can restart a finiteCOUNT, shift anINTERVAL, and calculate occurrences in the application's timezone instead of the schedule's timezone. Changing a saved schedule's timezone also leavesnext_run_atpointing to its old execution time.Both RRULE drivers now resolve a missing start once, when the expression is first evaluated or serialized. The generated
DTSTARTand effective timezone are stored byaddSchedule(), so reloading a schedule preserves its original timing. Explicit starts are left unchanged, and no database migration is required.Saving a timezone change on an existing schedule now recalculates
next_run_atfrom the current time. This applies to all drivers, preserveslast_run_at, and keeps disabled schedules disabled with no next run. Local RRULE starts keep the same date and time in the new timezone, without resettingCOUNTorINTERVAL.Existing stored expressions without
DTSTARTstill need an explicit intended start, since their original implicit start wasn't recorded. This is noted in the documentation.Validated with the full Pest suite (135 tests) and Pint.
Fixes #19.