From 61cd8d60e1497b2de9e291da86e06ac1facf59ca Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 16 Feb 2024 11:55:22 +1300 Subject: [PATCH 1/4] Adopt to `PluginDirectoryServiceRemote` changes --- WordPress/Classes/Stores/PluginStore.swift | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/WordPress/Classes/Stores/PluginStore.swift b/WordPress/Classes/Stores/PluginStore.swift index d8c909bedd5b..8d2ee0af5b0e 100644 --- a/WordPress/Classes/Stores/PluginStore.swift +++ b/WordPress/Classes/Stores/PluginStore.swift @@ -690,18 +690,17 @@ private extension PluginStore { } func fetchPluginDirectoryEntry(slug: String) { - let remote = PluginDirectoryServiceRemote() state.fetchingDirectoryEntry[slug] = true - remote.getPluginInformation( - slug: slug, - completion: { [actionDispatcher] (result) in - switch result { - case .success(let entry): - actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntry(slug: slug, entry: entry)) - case .failure(let error): - actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntryFailed(slug: slug, error: error)) - } - }) + + Task { @MainActor [actionDispatcher] in + do { + let remote = PluginDirectoryServiceRemote() + let entry = try await remote.getPluginInformation(slug: slug) + actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntry(slug: slug, entry: entry)) + } catch { + actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntryFailed(slug: slug, error: error)) + } + } } func receivePluginDirectoryEntry(slug: String, entry: PluginDirectoryEntry) { @@ -747,12 +746,12 @@ private extension PluginStore { func fetchPluginDirectoryFeed(feed: PluginDirectoryFeedType) { state.fetchingDirectoryFeed[feed.slug] = true - let remote = PluginDirectoryServiceRemote() - remote.getPluginFeed(feed) { [actionDispatcher] result in - switch result { - case .success(let response): + Task { @MainActor [actionDispatcher] in + do { + let remote = PluginDirectoryServiceRemote() + let response = try await remote.getPluginFeed(feed) actionDispatcher.dispatch(PluginAction.receivePluginDirectoryFeed(feed: feed, response: response)) - case .failure(let error): + } catch { actionDispatcher.dispatch(PluginAction.receivePluginDirectoryFeedFailed(feed: feed, error: error)) } } From 7d0b023640567edaf1c27ef907f3fbe7e83105b6 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 19 Feb 2024 12:22:34 +1300 Subject: [PATCH 2/4] Update WordPressKit --- Podfile | 2 +- Podfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Podfile b/Podfile index 280eb8a2103f..e066e2c1e05c 100644 --- a/Podfile +++ b/Podfile @@ -51,7 +51,7 @@ end def wordpress_kit # pod 'WordPressKit', '~> 13.0' - pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: 'dfb2134ca3b91233d44b3551d91844bf2087996f' + pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: 'ae8f83e5cffd14cc34cec863fc2d5c63e9658246' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: '' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', tag: '' # pod 'WordPressKit', path: '../WordPressKit-iOS' diff --git a/Podfile.lock b/Podfile.lock index 027915ebe487..b862d38971e9 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -120,7 +120,7 @@ DEPENDENCIES: - SwiftLint (~> 0.50) - WordPress-Editor-iOS (~> 1.19.9) - WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, commit `fa06fca7178b268d382d91861752b3be0729e8a8`) - - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `dfb2134ca3b91233d44b3551d91844bf2087996f`) + - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `ae8f83e5cffd14cc34cec863fc2d5c63e9658246`) - WordPressShared (~> 2.3) - WordPressUI (~> 1.15) - ZendeskSupportSDK (= 5.3.0) @@ -178,7 +178,7 @@ EXTERNAL SOURCES: :commit: fa06fca7178b268d382d91861752b3be0729e8a8 :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git WordPressKit: - :commit: dfb2134ca3b91233d44b3551d91844bf2087996f + :commit: ae8f83e5cffd14cc34cec863fc2d5c63e9658246 :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git CHECKOUT OPTIONS: @@ -189,7 +189,7 @@ CHECKOUT OPTIONS: :commit: fa06fca7178b268d382d91861752b3be0729e8a8 :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git WordPressKit: - :commit: dfb2134ca3b91233d44b3551d91844bf2087996f + :commit: ae8f83e5cffd14cc34cec863fc2d5c63e9658246 :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git SPEC CHECKSUMS: @@ -236,6 +236,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: d170fa8e270b2a32bef9dcdcabff5b8f1a5deced -PODFILE CHECKSUM: 91ca97cb58a7ec8391611ea499d341d47f633cda +PODFILE CHECKSUM: 951d83502d78264ef3f877d0472b009e53a61379 COCOAPODS: 1.14.2 From 6df354c3ef15031569804ef997da905aa105e898 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 19 Feb 2024 12:23:29 +1300 Subject: [PATCH 3/4] Add a release note --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 0cc165ff8bd7..fd43068ab31d 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,6 +5,7 @@ * [**] Multiple pre-publishing sheet fixes and improvements [#22606] * [*] Gravatar: Adds informative new view about Gravatar to the profile editing page. [#22615] * [**] [internal] Refactored .org REST API calls. [#22612] +* [**] [internal] Refactored viewing plugins from self-hosted sites. [#22622] 24.2 ----- From 1d50eb3869314362c429e85d8378670e0765cf58 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 19 Feb 2024 15:11:26 +1100 Subject: [PATCH 4/4] Use a WordPressKit version that should fix the Reader loading issues See how the UI tests failed in https://buildkite.com/automattic/wordpress-ios/builds/20452#018dbe88-2fc5-4998-ad35-1b455f547b59 The WordPressKit PR is https://github.com/wordpress-mobile/WordPressKit-iOS/pull/727 --- Podfile | 2 +- Podfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Podfile b/Podfile index e066e2c1e05c..7582a0f5a967 100644 --- a/Podfile +++ b/Podfile @@ -51,7 +51,7 @@ end def wordpress_kit # pod 'WordPressKit', '~> 13.0' - pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: 'ae8f83e5cffd14cc34cec863fc2d5c63e9658246' + pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '3df47e113c7647b76c049180e39489e3af7a27dc' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: '' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', tag: '' # pod 'WordPressKit', path: '../WordPressKit-iOS' diff --git a/Podfile.lock b/Podfile.lock index b862d38971e9..6511715f554b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -120,7 +120,7 @@ DEPENDENCIES: - SwiftLint (~> 0.50) - WordPress-Editor-iOS (~> 1.19.9) - WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, commit `fa06fca7178b268d382d91861752b3be0729e8a8`) - - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `ae8f83e5cffd14cc34cec863fc2d5c63e9658246`) + - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `3df47e113c7647b76c049180e39489e3af7a27dc`) - WordPressShared (~> 2.3) - WordPressUI (~> 1.15) - ZendeskSupportSDK (= 5.3.0) @@ -178,7 +178,7 @@ EXTERNAL SOURCES: :commit: fa06fca7178b268d382d91861752b3be0729e8a8 :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git WordPressKit: - :commit: ae8f83e5cffd14cc34cec863fc2d5c63e9658246 + :commit: 3df47e113c7647b76c049180e39489e3af7a27dc :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git CHECKOUT OPTIONS: @@ -189,7 +189,7 @@ CHECKOUT OPTIONS: :commit: fa06fca7178b268d382d91861752b3be0729e8a8 :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git WordPressKit: - :commit: ae8f83e5cffd14cc34cec863fc2d5c63e9658246 + :commit: 3df47e113c7647b76c049180e39489e3af7a27dc :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git SPEC CHECKSUMS: @@ -236,6 +236,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: d170fa8e270b2a32bef9dcdcabff5b8f1a5deced -PODFILE CHECKSUM: 951d83502d78264ef3f877d0472b009e53a61379 +PODFILE CHECKSUM: f732e6e39fc98112f1812c770b6bb5daf5a73672 COCOAPODS: 1.14.2