-
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
Automatically upload published and draft posts #12466
Automatically upload published and draft posts #12466
Conversation
Instead of just “Upload failed”, we’ll show “Draft will be uploaded…” instead.
The message “Draft will not be uploaded” is probably not necessary for it since it’s not cancelaeable anyway.
This will affect drafts with remote only.
This will be shown for posts with remote that have local changes and are confirmed to be automatically uploaded when the device is back online. This also reverts 4ce88f3. Now, we will show “Draft will be uploaded…” for local drafts instead of ”Local changes” only. This was discussed with Chris and it seems much clearer for the user.
And for posts with remote, always use “Changes will be uploaded…” as the notice message.
@osullivanchris I thought I'd send this to you first before I ask someone to review the code. Would you mind taking a quick look at the description and the screenshots above? Please let me know what you think. 🙂 |
Generated by 🚫 dangerJS |
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.
@shiki thanks for putting all these together, its great to see in one place and the before and after GIFs are really helpful. All looks great, +1 from me on this
@shiki When I tap "Update" (the right-upper button) on a published post, it shows me an alert containing an "Error occurred during saving". If I close the app and open it again I can see that the content was saved and the post was scheduled to be auto-published. Do you think this is something to be fixed inside the scope of this task? |
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.
WordPress/Classes/ViewRelated/Post/PostCardStatusViewModel.swift
Outdated
Show resolved
Hide resolved
WordPress/Classes/ViewRelated/Post/PostCardStatusViewModel.swift
Outdated
Show resolved
Hide resolved
This is just a helper method to make things a bit readable. It should only be used by `private var status: String?`
@leandroalonso Thank you for the review. I've responded to your comments. This is now ready for another look. |
WordPress/Classes/ViewRelated/Post/PostCardStatusViewModel.swift
Outdated
Show resolved
Hide resolved
This should have been a `post.isFailed` check but it’s better to just rely on the `guard` instead.
Good find here. That Update button requires the device to be online and I believe we decided not to touch it and keep it out of scope. However, we shouldn't mark the post as “confirmed for auto-upload” since we're not showing any message like “Changes will be published next time your device is online”. I'll take a look. |
@leandroalonso Actually, mind if we merge this and I'll fix that in a separate PR? I have a feeling the fix will take longer and with more tests. I reckon it's going to be related to #12498 too. 😬 |
Since his issue is blocking #12362 and has been approved and confirmed for merge by @leandroalonso , I am merging this. |
@leandroalonso Looping back on #12466 (comment). I created an issue for it: #12589. |
Closes #12324.
This adds auto-uploading support for published and draft posts that were previously uploaded to the server. The main change is the removal of
!post.hasRemote()
inPostAutoUploadInteractor
.This also incorporates the related changes as described in the pending tasks in Android:
The rest of the changes are automated tests.
Previews and Testing Steps
Local draft
Editing an existing draft
Publishing a local draft
Editing an existing published post
Reviewing
Only 1 reviewer is needed but anyone can review.
Submitter Checklist
RELEASE-NOTES.txt
if necessary.Tasks