fix: keep post drafts unscheduled by default - #209
Merged
Conversation
cursor
Bot
force-pushed
the
fix/unscheduled-drafts
branch
2 times, most recently
from
August 1, 2026 18:16
e28f12a to
b34a397
Compare
Require scheduled_at only when status is scheduled and the post has no usable future schedule. Share that rule across web, API, and MCP, keep create without a date as null, and preserve the legacy date → 09:00 UTC fallback.
cursor
Bot
force-pushed
the
fix/unscheduled-drafts
branch
from
August 1, 2026 18:16
b34a397 to
38b0945
Compare
Type requiresExplicitSchedule status as ?string, reuse a local status variable in request/tool validation, tighten the web reject assertion, and collapse overlapping MCP unscheduled-create cases.
Reuse the typed status() helper across FormRequests and the already-parsed $status in UpdatePostTool so schedule checks stay consistent and less noisy.
Centralize schedule validation in PostStatusRules, normalize status parsing in one place, and align past-schedule coverage across entry points.
Add feature coverage for null/past schedule rejection, explicit scheduling, draft saves, publish-now without a schedule, calendar exclusion, and 09:00 UTC date defaults across web, API, and MCP.
Keep the inline is_string check at the few call sites that read raw request status before validation — no shared wrapper needed. Co-authored-by: Cursor <cursoragent@cursor.com>
Accept mixed status in PostStatusRules and rely on strict comparisons with Rule::requiredIf / Rule::when — malformed input simply does not match. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
@drbelt27 thank you, i have improved that... and it's merged on main branch. |
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
Drafts no longer get an implicit schedule. Creating a post without
scheduled_at/dateleavesscheduled_at = null. Moving a post toscheduledrequires an explicit future datetime unless the post already has a reusable future schedule.Shared across web, public API, and MCP via
PostStatusRules::scheduledAtRules()/requiresExplicitSchedule()so the three entry points cannot drift.Publish-now is unchanged:
status = publishingstill setsscheduled_at = now()and dispatches publish.Behavior
scheduled_at = nulldate=YYYY-MM-DDscheduled_atscheduledwith noscheduled_atand post has none/pastscheduled_atscheduledreusing an existing futurescheduled_atscheduledwith a pastscheduled_atafter:nowapplied)publishing)scheduled_at = now()Test plan
Create / drafts
scheduled_at = nulldate→ draft scheduled that day at 09:00 UTCscheduled_at→ draft,scheduled_at = nullscheduled_at→ validation errornullschedule → unscheduled draftscheduled_at→ validation errorSchedule update (web / API / MCP)
scheduled_at = null+status=scheduledwithout new time → rejected (scheduled_atrequired)scheduled_at+status=scheduledwithout new time → rejectedstatus=scheduled+ pastscheduled_at→ rejected (after:now)scheduled_at+status=scheduledwithout resubmitting time → succeeds and keeps the same datetimestatus=scheduled+ valid futurescheduled_at→ succeedsstatus=draftand noscheduled_at→ still succeeds (stays unscheduled)Publish now
status=publishingwithoutscheduled_at→ publishes;scheduled_atbecomes ~nowRegression smoke