Skip to content

Conversation

crazytonyli
Copy link
Contributor

Description

Here is a recording.

ScreenRecording_09-26-2025.22-53-19_1.MP4

@crazytonyli crazytonyli added this to the 26.4 milestone Sep 26, 2025
<string>spectrum-&apos;22-icon-app-83.5x83.5</string>
<string>spectrum-'22-icon-app-60x60</string>
<string>spectrum-'22-icon-app-76x76</string>
<string>spectrum-'22-icon-app-83.5x83.5</string>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xcode made these changes. Xcode also made the original changes. Somehow, Xcode decides to revert changes that were made by itself...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What version of Xcode are you on?

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number29235
VersionPR #24891
Bundle IDorg.wordpress.alpha
Commit1e19fd0
Installation URL2vpnkn5hq25ug
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number29235
VersionPR #24891
Bundle IDcom.jetpack.alpha
Commit1e19fd0
Installation URL6k1sseh9ahdjo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad we're doing this, but I'm concerned about how many errors we're ignoring.

Any IO error shouldn't be ignored, otherwise we end up with impossible-to-debug issues.

I'm also curious what happens if a user schedules an image for upload then immediately deletes it before it starts uploading (or while it's in progress)

@wpmobilebot wpmobilebot modified the milestones: 26.4, 26.5 Oct 2, 2025
@wpmobilebot
Copy link
Contributor

Version 26.4 has now entered code-freeze, so the milestone of this PR has been updated to 26.5.

Copy link
Contributor

@kean kean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks pretty neat! LGTM, but disclaimer I'm not familiar with this API.

I left one main comment about actor vs MainActor and I'd also consider monitoring using MediaCoordinator (latest example).

In terms of features, I'm not sure it should be shown for quick operations like uploading a site image or a featured image for a post – it may be too overwhelming, and other apps don't do this. I think it should be reserved only for actually long background operations like uploading large videos or multiple files.

<string>spectrum-&apos;22-icon-app-83.5x83.5</string>
<string>spectrum-'22-icon-app-60x60</string>
<string>spectrum-'22-icon-app-76x76</string>
<string>spectrum-'22-icon-app-83.5x83.5</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What version of Xcode are you on?


@available(iOS 26.0, *)
/// Utilize `BGContinuedProcessingTask` to show the uploading media activity.
private actor ConcreteMediaUploadBackgroundTracker: MediaUploadBackgroundTracker {
Copy link
Contributor

@kean kean Oct 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixing actor isolation with @MainActor functions (updateMessaging, updateResult) adds complexity. I would suggest to synchronize ConcreteMediaUploadBackgroundTracker itself on the main thread as it doesn't perform any work and potentially creates more CPU overhead by adding context switches and by re-reading stuff from the Core Data. MediaCoordinator, PostMediaUploadsViewModel, etc are also all synchronized on main also for simplicity.

private var state: BGTaskState = .idle

private init?() {
let taskId = (Bundle.main.infoDictionary?["BGTaskSchedulerPermittedIdentifiers"] as? [String])?.first {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) I'd suggest making init non-optional to remove the need for the code using this class to deal with the optional.

}

let success = mediaItems.allSatisfy { $0.remoteStatus == .sync }
await setTaskCompleted(success: success)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not) this is the kind of complexity – one function with three concurrent code sections – I mentioned earlier that could be easily eliminated by synchronizing the class on main. You may end up code sections from updateMessaging and updateResult being intertwined in any order, so it's hard to reason about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants