-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Publish Date button to Post Settings #23333
Conversation
// the app has to send a new value to override it. | ||
parameters.date = post.shouldPublishImmediately() ? nil : Date() | ||
} | ||
parameters.date = options.publishDate ?? .now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safest option is to just to set to .now
every time unless it's explicitly provided.
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr23333-14e67ee | |
Version | 25.0 | |
Bundle ID | org.wordpress.alpha | |
Commit | 14e67ee | |
App Center Build | WPiOS - One-Offs #10131 |
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr23333-14e67ee | |
Version | 25.0 | |
Bundle ID | com.jetpack.alpha | |
Commit | 14e67ee | |
App Center Build | jetpack-installable-builds #9179 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenario 3 doesn't work properly. Although after setting a post draft date it correctly turns into a "Schedule" state, the publish date is shown "Immediately". It only happens after initially saving the draft. The date is correctly shown after setting it in post settings after initially saving the draft.
Scenario.3.broken.mp4
I'm not sure it's feasible to make it work correctly in all scenarios considering how the API works. The root cause is that if you pass
There is another related issue: the "edited" date in the Post List is incorrect for these posts. I added a workaround where the first time you save a draft, it doesn't send This is one of the many reasons we removed this field... |
709b449
to
14e67ee
Compare
Thanks for providing context, @kean. 🤔
Okay... It explains the weird behavior I was seeing. The date picker shows "Immediately" but once I opened it, the date was set to the future date I set before saving the draft.
As I understand, this workaround is not expected to work with WP.com API for now? And how does WP.com solve this problem? I cannot reproduce the same issue. Setting the publish date and saving the draft works well.
Yes, I understand now why it was removed. It should be fixed from the backend side. |
wp.com creates a post on the server the moment you open a new draft (and this is when it sets the initial |
Okay, @kean. So it does sound a bit like another workaround you proposed:
What I dislike about the current state is that it leaves many contradictions. For example, for a draft that had a publish date set to the next day, we:
Simulator.Screen.Recording.-.iPhone.15.-.2024-06-10.at.15.47.59.mp4If we don't support publish dates for initial drafts but want to show the publish date in post settings for immediate scheduling, could we remove the created date when the initial draft is saved? At least then the UI will be consistent and display "Publish" instead of "Schedule". 🤔 I realize that none of these options is ideal. |
Hey folks 👋 , I'm going to run code freeze now. Once it's ready, feel free to update the base branch to |
I think that's what I ended up doing If I understood your suggestion correctly.
Sure! |
👋 Code freeze for 25.1 has been completed. You can now target the |
Tracks show that the "prepublishing flow" works just fine. I'm going to close it for now. |
Fixes #23326.
I tried to re-implement it on top of the new infrastructure and avoid the old issues. 99% of users will just go "Post Settings" → Set "Publish Date" → "Schedule" → "Schedule". Other scenarios – and it opens the door for dozens of these – are largely irrelevant.
For reference, here are the related previous issues (some might by misclassified): #12121, #13724, #14251, #18517, #17086, #15767, #16514, #13654.
Note
This fix targets 25.1.
To test:
Scenario 1
Scheduling a draft post using Post Settings.
Scenario 2
Scenario 3
Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: