Skip to content

Adopt PluginDirectoryServiceRemote changes #22622

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

Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: '3df47e113c7647b76c049180e39489e3af7a27dc'
Copy link
Contributor

Choose a reason for hiding this comment

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

This commit points to wordpress-mobile/WordPressKit-iOS#727 which, I'm happy to say, seems to address the reader issue that the UI tests picked up in previous runs (see #22612)

# 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'
Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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 `3df47e113c7647b76c049180e39489e3af7a27dc`)
- WordPressShared (~> 2.3)
- WordPressUI (~> 1.15)
- ZendeskSupportSDK (= 5.3.0)
Expand Down Expand Up @@ -178,7 +178,7 @@ EXTERNAL SOURCES:
:commit: fa06fca7178b268d382d91861752b3be0729e8a8
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git
WordPressKit:
:commit: dfb2134ca3b91233d44b3551d91844bf2087996f
:commit: 3df47e113c7647b76c049180e39489e3af7a27dc
:git: https://github.com/wordpress-mobile/WordPressKit-iOS.git

CHECKOUT OPTIONS:
Expand All @@ -189,7 +189,7 @@ CHECKOUT OPTIONS:
:commit: fa06fca7178b268d382d91861752b3be0729e8a8
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git
WordPressKit:
:commit: dfb2134ca3b91233d44b3551d91844bf2087996f
:commit: 3df47e113c7647b76c049180e39489e3af7a27dc
:git: https://github.com/wordpress-mobile/WordPressKit-iOS.git

SPEC CHECKSUMS:
Expand Down Expand Up @@ -236,6 +236,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
ZIPFoundation: d170fa8e270b2a32bef9dcdcabff5b8f1a5deced

PODFILE CHECKSUM: 91ca97cb58a7ec8391611ea499d341d47f633cda
PODFILE CHECKSUM: f732e6e39fc98112f1812c770b6bb5daf5a73672

COCOAPODS: 1.14.2
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
31 changes: 15 additions & 16 deletions WordPress/Classes/Stores/PluginStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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))
}
}
Expand Down