Skip to content
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

Update synced media references when saving a post with ongoing uploads #17157

Merged
merged 5 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-----
* [*] Fixed a bug on Reader that prevented Saved posts to be removed
* [*] Share Extension: Allow creation of Pages in addition to Posts. [#16084]
* [*] Fixed an issue where images point to local URLs in the editor when saving a post with ongoing uploads. [#17157]

18.2
-----
Expand Down
7 changes: 7 additions & 0 deletions WordPress/Classes/Services/PostCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ class PostCoordinator: NSObject {
return
}

// Ensure that all synced media references are up to date
post.media.forEach { media in
if media.remoteStatus == .sync {
self.updateReferences(to: media, in: post)
}
}

let uuid = observeMedia(for: post, completion: completion)
trackObserver(receipt: uuid, for: post)

Expand Down