-
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
Posting/Editing: posts created and edited in the app then edited on the web are published with the wrong date #17086
Comments
Maybe something related? It sounds familiar, but I don't remember the web component.
I'd guess it might be related to how (if?) the apps set/update the value of |
I didn't have time to fix this issue during my Groundskeeping rotation, but below are my investigation notes. If a draft post is edited in the app, the publish date is set to the previous revision date -- you don't need to edit the post in Calypso to repro this issue.
It is. A draft post will "publish immediately" only when WordPress-iOS/WordPress/Classes/Models/AbstractPost.h Lines 23 to 28 in a08cc72
WordPress-iOS/WordPress/Classes/Models/AbstractPost.m Lines 426 to 429 in a08cc72
WordPress-iOS/WordPress/Classes/Models/AbstractPost.m Lines 247 to 250 in a08cc72
It looks like Calypso updates date_created when saving drafts. On the app, we do not update
Currently on the app if you revert a published post to a draft post (Post Settings > Status > Draft), the original publish date is preserved. However we'll need to make sure that updating WordPress-iOS/WordPress/Classes/ViewRelated/Post/Scheduling/PublishSettingsViewController.swift Lines 43 to 44 in c27ea7c
|
I've tried quite a bit of things here. I made it work on iOS but I suspect there's a problem on Calypso too. if (![post originalIsDraft]) {
remotePost.date = post.date_created_gmt;
} This way we would only update the date when a post is not draft. And when we pass BUT after doing an update on the draft from iOS, if we go ahead and do an update from Calypso, the TIP for testing this: |
The "Publish Date" fields was removed in 24.9 and the app never sends the |
Expected behavior
I expect the current date and time to be used when I click the Publish button on a draft regardless of where it was edited.
Actual behavior
If a draft created in the app is edited using the app and then edited using the Calypso editor, the final publish date will be the creation date from the app.
Steps to reproduce the behavior
Results: if a revision is saved by the iOS app and the post is edited using the Calypso editor after that, the post publish date will be set to the date and time it was originally created in the app and not the date and time the post is actually published.
Notes: you can hover over the publish date in the Posts list on the web to see the exact date of publish (screenshot).
Tested on iPhone 11, iOS 15.0 beta 6, WPiOS 18.0.2 (TestFlight beta).
/hat tip @elibud for the bug report and @startuptester for help confirming the steps to reproduce.
/cc @aerych because I believe you have worked on this sort of thing in the past and you may have tips about how to solve the problem.
The text was updated successfully, but these errors were encountered: