Publishing quiet hours with timezone support #129
Labels
No labels
bug
devops
duplicate
enhancement
good first issue
layout
next major release
next minor release
question
research
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/fedi-feed-router#129
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Suppress automatic publishing during configured hours, interpreted in a user-set timezone.
Split out of #90 "Publishing schedule control", which bundled four independent features.
Why timezone is part of this ticket
config/app.phpsets'timezone' => 'UTC'. Quiet hours of 08:00–22:00 interpreted in UTC are not the hours a user in Brussels means. Quiet hours is unshippable without a timezone setting, so the two cannot be separate tickets — timezone is a prerequisite, not a sibling feature.Settings
publishing_timezoneUTCDateTimeZone::listIdentifiers()quiet_hours_enabledfalsequiet_hours_start22:00HH:MMquiet_hours_end08:00HH:MMDefaulting to disabled matters: an existing install must publish exactly as it does today until someone opts in.
Design
PublishingWindowvalue object holding the quiet-hours logic, unit-testable without touching the job.PublishNextArticleJobbefore article selection — quiet hours are article-independent, so there's no reason to run the candidate query.start > endthe window wraps, so the check isnow >= start || now < end. Otherwisenow >= start && now < end.Tasks
publishing_timezonesetting + validation +Settingaccessorsquiet_hours_enabled/quiet_hours_start/quiet_hours_endsettingsPublishingWindowvalue objectPublishNextArticleJobSettingsControllerEdge cases that must be tested
start == endConstraints
PublishNextArticleJobisShouldBeUniquewithuniqueFor = 300on a five-minute schedule. Confirm an early return releases the unique lock rather than suppressing the following tick, before adding a new early-return path.Do not weaken #123 (
Cache::lockduplicate guard) or #119 (scopeDueForPublishingis the single source of truth for publish eligibility — do not re-express that threshold in a new query).