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

iOS 18 Support #23527

Merged
merged 30 commits into from
Sep 24, 2024
Merged

iOS 18 Support #23527

merged 30 commits into from
Sep 24, 2024

Conversation

jkmassel
Copy link
Contributor

Adds iOS 18 support – we're not building against that SDK yet, but right now this PR:

  1. Adds iOS 18 tint-able icons
  2. Builds the app with Xcode 16

To test:
Ensure CI passes

@dangermattic
Copy link
Collaborator

dangermattic commented Aug 28, 2024

3 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 25.4. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Aug 28, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23527-d2410ee
Version25.3
Bundle IDorg.wordpress.alpha
Commitd2410ee
App Center BuildWPiOS - One-Offs #10727
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Aug 28, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23527-d2410ee
Version25.3
Bundle IDcom.jetpack.alpha
Commitd2410ee
App Center Buildjetpack-installable-builds #9771
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@kean kean marked this pull request as ready for review September 19, 2024 12:44
@kean kean requested review from kean and crazytonyli and removed request for kean September 19, 2024 12:44
@kean kean self-requested a review September 19, 2024 13:32
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.

I made some more minor changes and updated the .xcode-version. The icons looks good, and everything else too.

@kean kean added the General label Sep 19, 2024
@kean kean added this to the 25.4 milestone Sep 19, 2024
WordPress/Classes/Utility/ImmuTable.swift Outdated Show resolved Hide resolved
@@ -486,6 +486,10 @@ extension UITableViewController: TableViewContainer {}

// MARK: - Diffable

// This conformance was added during the Xcode 16 migration to silence the
// dozens of false-positive warnigns (any @unchecked conformance is tech debt).
extension AnyHashable: @retroactive @unchecked Sendable {}
Copy link
Contributor

Choose a reason for hiding this comment

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

This line has a much bigger impact than the individual @checked Sendable: all AnyHashable instances now get Sendable during runtime, which feels like an unsafe change...

I don't have any solution to solve the warning without changing how the two types below are used. Maybe we can tolerate the warnings for now until a proper ImmuTable refactor?

Copy link
Contributor

@kean kean Sep 19, 2024

Choose a reason for hiding this comment

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

all AnyHashable instances now get Sendable during runtime, which feels like an unsafe change

It brings the app back to the status quo where in Xcode 15.4 where all AnyHashable instances were also not producing any concurrency warnings.

Maybe we can tolerate the warnings for now until a proper ImmuTable refactor?

Unfortunately no because the vast majority of warnings are due to this type.

e0c0ac73f66f4dd5

I don't have any solution to solve the warning without changing how the two types below are used.

The problem is two-fold:

  • UITableViewDiffableDataSource requiring Sendable even when you never use it from the background (you can but very few people actually do). I think it's a pretty major limitation of the design of data race safety features in Swift 6.
  • AnyHashable can't become Sendable conditionally based on the type is is parameterized with because it erases this type at compile time.

The only fix seems to be to stop using AnyHashable.

Co-authored-by: Tony Li <tony.li@automattic.com>
@kean kean enabled auto-merge September 23, 2024 16:10
@@ -79,7 +79,7 @@ steps:
context: "UI Tests (iPhone)"

- label: "🔬 :jetpack: UI Tests (iPad)"
command: .buildkite/commands/run-ui-tests.sh 'iPad Pro 13-inch (M4)'
command: .buildkite/commands/run-ui-tests.sh 'iPad (10th generation) (17.5)'
Copy link
Contributor

@kean kean Sep 24, 2024

Choose a reason for hiding this comment

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

I stopped trying to get it to work because I have another branch where I remove the .sidebar FF and with a fully updated set of tests.

let view = controller.navigationController?.view.subviews.first { view in
return view is SuggestionsTableView
}
let suggestionsTableView = try XCTUnwrap(view)
Copy link
Contributor

Choose a reason for hiding this comment

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

I spent a good hour trying to debug this but because these tests don't follow best practices for unit testing and are evaluating the UIKit components, I made a call to remove them.

@@ -52,6 +52,13 @@ final class NotificationsViewControllerTests: XCTestCase {
postAccountChangeNotification()

// Then
// TODO: rework this unit test
let expectation = self.expectation(description: "setBadgeCount")
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests are failing because the deprecated applicationIconBadgeNumber property now works asynchronously. It's not great, but we can rework it when we remove the deprecated API.

@kean kean force-pushed the ios-18-changes branch 2 times, most recently from a749182 to a3778b7 Compare September 24, 2024 19:58
@kean kean added this pull request to the merge queue Sep 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 24, 2024
@kean kean added this pull request to the merge queue Sep 24, 2024
Merged via the queue into trunk with commit 3c8276c Sep 24, 2024
24 checks passed
@kean kean deleted the ios-18-changes branch September 24, 2024 21:41
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.

5 participants