From ef93b89a8ec1c952a655fbd2d9d5495598b45ec4 Mon Sep 17 00:00:00 2001 From: Momo Ozawa Date: Mon, 27 Mar 2023 11:04:24 +0100 Subject: [PATCH 1/7] Fix: update blog instance from the correct thread --- WordPress/Classes/Services/BlazeService.swift | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/WordPress/Classes/Services/BlazeService.swift b/WordPress/Classes/Services/BlazeService.swift index 5360cef45f95..2a1010c81e33 100644 --- a/WordPress/Classes/Services/BlazeService.swift +++ b/WordPress/Classes/Services/BlazeService.swift @@ -33,31 +33,41 @@ import WordPressKit completion: (() -> Void)? = nil) { guard BlazeHelper.isBlazeFlagEnabled() else { - updateBlog(blog, isBlazeApproved: false, completion: completion) + updateBlogWithID(blog.objectID, isBlazeApproved: false, completion: completion) return } guard let siteId = blog.dotComID?.intValue else { DDLogError("Invalid site ID for Blaze") - updateBlog(blog, isBlazeApproved: false, completion: completion) + updateBlogWithID(blog.objectID, isBlazeApproved: false, completion: completion) return } remote.getStatus(forSiteId: siteId) { result in switch result { case .success(let approved): - self.updateBlog(blog, isBlazeApproved: approved, completion: completion) + self.updateBlogWithID(blog.objectID, isBlazeApproved: approved, completion: completion) case .failure(let error): DDLogError("Unable to fetch isBlazeApproved value from remote: \(error.localizedDescription)") - self.updateBlog(blog, isBlazeApproved: false, completion: completion) + self.updateBlogWithID(blog.objectID, isBlazeApproved: false, completion: completion) } } } - private func updateBlog(_ blog: Blog, isBlazeApproved: Bool, completion: (() -> Void)? = nil) { + private func updateBlogWithID(_ objectID: NSManagedObjectID, + isBlazeApproved: Bool, + completion: (() -> Void)? = nil) { contextManager.performAndSave({ context in + + guard let blog = context.object(with: objectID) as? Blog else { + DDLogError("Unable to update isBlazeApproved value for blog") + completion?() + return + } + blog.isBlazeApproved = isBlazeApproved DDLogInfo("Successfully updated isBlazeApproved value for blog: \(isBlazeApproved)") + }, completion: { completion?() }, on: .main) From 173bc45f1bd9b8932ff3322595f7684921a44190 Mon Sep 17 00:00:00 2001 From: Salim Braksa Date: Mon, 27 Mar 2023 21:21:07 +0000 Subject: [PATCH 2/7] Safe unwrap optional values to prevent crashing the app when blocking post authors --- .../Services/Reader Post/ReaderPostService.swift | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/Services/Reader Post/ReaderPostService.swift b/WordPress/Classes/Services/Reader Post/ReaderPostService.swift index 0233277dcec6..c3a58a6803f3 100644 --- a/WordPress/Classes/Services/Reader Post/ReaderPostService.swift +++ b/WordPress/Classes/Services/Reader Post/ReaderPostService.swift @@ -157,17 +157,24 @@ extension ReaderPostService { /// Takes a list of remote posts and returns a new list without the blocked posts. private func remotePostsByFilteringOutBlockedPosts(_ posts: [RemoteReaderPost], in context: NSManagedObjectContext) -> [RemoteReaderPost] { - guard let account = try? WPAccount.lookupDefaultWordPressComAccount(in: context) else { + guard let account = try? WPAccount.lookupDefaultWordPressComAccount(in: context), + let accountID = account.userID + else { return posts } - let blockedAuthors = Set(BlockedAuthor.find(.accountID(account.userID), context: context).map { $0.authorID }) + let blockedAuthors = Set(BlockedAuthor.find(.accountID(accountID), context: context).map { $0.authorID }) guard !blockedAuthors.isEmpty else { return posts } - return posts.filter { !blockedAuthors.contains($0.authorID) } + return posts.filter { post -> Bool in + guard let authorID = post.authorID else { + return true + } + return !blockedAuthors.contains(authorID) + } } // MARK: - Types From 3450b7da165e5d254b044b2fe2347ccd006bb471 Mon Sep 17 00:00:00 2001 From: Salim Braksa Date: Mon, 27 Mar 2023 22:20:50 +0000 Subject: [PATCH 3/7] Update release notes --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 8b92b5272978..2d209a57bc72 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -16,6 +16,7 @@ * [*] [internal] Refactor uploading media assets. [#20294] * [*] Block editor: Allow new block transforms for most blocks. [https://github.com/WordPress/gutenberg/pull/48792] * [*] Visual improvements were made to the in-app survey along with updated text to differentiate between the WordPress and Jetpack apps. [#20276] +* [*] Reader: Resolve an issue that could cause the app to crash when blocking a post author. [#20421] 21.9 ----- From 20eddd86c7fc3d3856e0dde3b199b055fe2057b5 Mon Sep 17 00:00:00 2001 From: Momo Ozawa Date: Tue, 28 Mar 2023 15:06:20 +0100 Subject: [PATCH 4/7] =?UTF-8?q?Fix:=20don=E2=80=99t=20call=20completion=20?= =?UTF-8?q?closure=20during=20core=20data=20ops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WordPress/Classes/Services/BlazeService.swift | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/WordPress/Classes/Services/BlazeService.swift b/WordPress/Classes/Services/BlazeService.swift index 2a1010c81e33..1e90c5477ec8 100644 --- a/WordPress/Classes/Services/BlazeService.swift +++ b/WordPress/Classes/Services/BlazeService.swift @@ -3,12 +3,12 @@ import WordPressKit @objc final class BlazeService: NSObject { - private let contextManager: CoreDataStack + private let contextManager: CoreDataStackSwift private let remote: BlazeServiceRemote // MARK: - Init - required init?(contextManager: CoreDataStack = ContextManager.shared, + required init?(contextManager: CoreDataStackSwift = ContextManager.shared, remote: BlazeServiceRemote? = nil) { guard let account = try? WPAccount.lookupDefaultWordPressComAccount(in: contextManager.mainContext) else { return nil @@ -28,7 +28,7 @@ import WordPressKit /// /// - Parameters: /// - blog: A blog - /// - completion: Closure to be called on success + /// - completion: Closure to be called on completion @objc func getStatus(for blog: Blog, completion: (() -> Void)? = nil) { @@ -58,16 +58,12 @@ import WordPressKit isBlazeApproved: Bool, completion: (() -> Void)? = nil) { contextManager.performAndSave({ context in - - guard let blog = context.object(with: objectID) as? Blog else { - DDLogError("Unable to update isBlazeApproved value for blog") - completion?() + guard let blog = try? context.existingObject(with: objectID) as? Blog else { + DDLogError("Unable to fetch blog and update isBlazedApproved value") return } - blog.isBlazeApproved = isBlazeApproved DDLogInfo("Successfully updated isBlazeApproved value for blog: \(isBlazeApproved)") - }, completion: { completion?() }, on: .main) From bb479287d5c2f57649a3260468401eba7853692a Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 29 Mar 2023 16:31:47 +1100 Subject: [PATCH 5/7] =?UTF-8?q?Update=20app=20translations=20=E2=80=93=20`?= =?UTF-8?q?Localizable.strings`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/id.lproj/Localizable.strings | 56 ++++++++++++++++++- .../Resources/ru.lproj/Localizable.strings | 5 +- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/WordPress/Resources/id.lproj/Localizable.strings b/WordPress/Resources/id.lproj/Localizable.strings index 73560d0a8835..8d6c9d1ada54 100644 --- a/WordPress/Resources/id.lproj/Localizable.strings +++ b/WordPress/Resources/id.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* Translation-Revision-Date: 2023-03-09 11:54:28+0000 */ +/* Translation-Revision-Date: 2023-03-24 11:54:08+0000 */ /* Plural-Forms: nplurals=2; plural=n > 1; */ /* Generator: GlotPress/4.0.0-alpha.4 */ /* Language: id */ @@ -9618,6 +9618,12 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */ /* Age between dates equaling one hour. */ "an hour" = "satu jam"; +/* This is the string we display when prompting the user to review the Jetpack app */ +"appRatings.jetpack.prompt" = "Apa pendapat Anda tentang Jetpack?"; + +/* This is the string we display when prompting the user to review the WordPress app */ +"appRatings.wordpress.prompt" = "Apa pendapat Anda tentang WordPress?"; + /* Label displayed on audio media items. */ "audio" = "audio"; @@ -9848,6 +9854,9 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */ /* Title of a badge indicating when a feature in singular form will be removed. First argument is the feature name. Second argument is the number of days/weeks it will be removed in. Ex: Reader is moving in 2 weeks */ "jetpack.branding.badge_banner.moving_in.singular" = "%1$@ akan berpindah dalam %2$@"; +/* Title of a badge or banner indicating that this feature will be moved in a few days. */ +"jetpack.branding.badge_banner.moving_in_days.plural" = "Berpindah ke aplikasi Jetpack dalam beberapa hari."; + /* Title of a badge indicating that a feature in plural form will be removed soon. First argument is the feature name. Ex: Notifications are moving soon */ "jetpack.branding.badge_banner.moving_soon.plural" = "%@ segera berpindah"; @@ -10157,12 +10166,57 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */ /* The title in the migration welcome screen */ "migration.welcome.title" = "Selamat datang di Jetpack!"; +/* Description for the static screen displayed prompting users to switch the Jetpack app. */ +"movedToJetpack.description" = "Statistik, Pembaca, Pemberitahuan, dan beragam fitur lain berbasis Jetpack telah dihapus dari aplikasi WordPress dan hanya dapat ditemukan di aplikasi Jetpack."; + +/* Hint for the static screen displayed prompting users to switch the Jetpack app. */ +"movedToJetpack.hint" = "Beralihlah ke aplikasi—gratis dan prosesnya cepat!"; + +/* Title for a button that prompts users to switch to the Jetpack app. */ +"movedToJetpack.jetpackButtonTitle" = "Ganti ke aplikasi Jetpack"; + +/* Title for a button that displays a blog post in a web view. */ +"movedToJetpack.learnMoreButtonTitle" = "Baca selengkapnya di jetpack.com"; + +/* Title for the static screen displayed in the Stats screen prompting users to switch to the Jetpack app. */ +"movedToJetpack.notifications.title" = "Pemberitahuan berpindah ke aplikasi Jetpack."; + +/* Title for the static screen displayed in the Reader screen prompting users to switch to the Jetpack app. */ +"movedToJetpack.reader.title" = "Pembaca berpindah ke aplikasi Jetpack."; + +/* Title for the static screen displayed in the Stats screen prompting users to switch to the Jetpack app. */ +"movedToJetpack.stats.title" = "Statistik berpindah ke aplikasi Jetpack."; + +/* Title for the card displaying draft posts. */ +"my-sites.drafts.card.title" = "Sempurnakan konsep pos"; + +/* The part in the title that should be highlighted. */ +"my-sites.drafts.card.title.hint" = "buat konsep pos"; + +/* Title for the card displaying today's stats. */ +"my-sites.stats.card.title" = "Statistik Hari Ini"; + +/* The part of the title that needs to be emphasized */ +"my-sites.stats.card.title.hint" = "Statistik"; + /* Dismiss button title. */ "noResultsViewController.dismissButton" = "Tutup"; /* Dismiss the alert with instructions on how to enable push notifications. */ "notificationSettingStreams.pushNotificationAlert.dismissButton" = "Tutup"; +/* This is one of the buttons we display inside of the prompt to review the app */ +"notifications.appRatings.prompt.no.buttonTitle" = "Dapat disempurnakan"; + +/* This is one of the buttons we display inside of the prompt to review the app */ +"notifications.appRatings.prompt.yes.buttonTitle" = "Saya menyukainya"; + +/* This is one of the buttons we display when prompting the user for a review */ +"notifications.appRatings.sendFeedback.no.buttonTitle" = "Tidak, terima kasih"; + +/* This is one of the buttons we display when prompting the user for a review */ +"notifications.appRatings.sendFeedback.yes.buttonTitle" = "Beri masukan"; + /* Word separating the current index from the total amount. I.e.: 7 of 9 */ "of" = "dari"; diff --git a/WordPress/Resources/ru.lproj/Localizable.strings b/WordPress/Resources/ru.lproj/Localizable.strings index 8e8f63ed8914..746035c7da24 100644 --- a/WordPress/Resources/ru.lproj/Localizable.strings +++ b/WordPress/Resources/ru.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* Translation-Revision-Date: 2023-03-22 18:54:08+0000 */ +/* Translation-Revision-Date: 2023-03-28 11:16:56+0000 */ /* Plural-Forms: nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); */ /* Generator: GlotPress/4.0.0-alpha.4 */ /* Language: ru */ @@ -10196,6 +10196,9 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */ /* Title for the card displaying draft posts. */ "my-sites.drafts.card.title" = "Работа над черновой записью"; +/* The part in the title that should be highlighted. */ +"my-sites.drafts.card.title.hint" = "Черновая запись"; + /* Title for the card displaying today's stats. */ "my-sites.stats.card.title" = "Статистика за сегодня"; From dbc8726512a2135570ec94e82e8a58a79692cf00 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 29 Mar 2023 16:32:19 +1100 Subject: [PATCH 6/7] Update WordPress metadata translations --- fastlane/metadata/es-ES/release_notes.txt | 3 +++ fastlane/metadata/tr/release_notes.txt | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 fastlane/metadata/es-ES/release_notes.txt create mode 100644 fastlane/metadata/tr/release_notes.txt diff --git a/fastlane/metadata/es-ES/release_notes.txt b/fastlane/metadata/es-ES/release_notes.txt new file mode 100644 index 000000000000..3924c54c7a79 --- /dev/null +++ b/fastlane/metadata/es-ES/release_notes.txt @@ -0,0 +1,3 @@ +No sabemos si es vuestro caso, pero nos sentimos de 22 años. En honor a la ocasión (y porque lo habéis estado pidiendo), ahora podéis convertir la mayor parte de bloques en otros tipos de bloques, como citas, columnas, y grupos. Hermoso. + +También veréis algunos pequeños cambios visuales en el escritorio de «Mi sitio» y en la encuesta dentro de la app. diff --git a/fastlane/metadata/tr/release_notes.txt b/fastlane/metadata/tr/release_notes.txt new file mode 100644 index 000000000000..b5d150004918 --- /dev/null +++ b/fastlane/metadata/tr/release_notes.txt @@ -0,0 +1,3 @@ +Sizi bilmiyoruz ama biz kendimizi 22 yaşında hissediyoruz. Bu olayın şerefine (ve bunu istediğiniz için), artık çoğu blok türünü tırnak, sütun ve grup gibi diğer blok türlerine dönüştürebilirsiniz. Ne güzel. + +Ayrıca Sitem panosunda ve uygulama içi ankette birkaç küçük görsel değişiklik göreceksiniz. From 7216234e8f54ba82363f122fd61b132e8eecc1c0 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 29 Mar 2023 16:32:39 +1100 Subject: [PATCH 7/7] Bump version number --- config/Version.internal.xcconfig | 2 +- config/Version.public.xcconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/Version.internal.xcconfig b/config/Version.internal.xcconfig index 52fa89ecb66b..1e7b7d5af25e 100644 --- a/config/Version.internal.xcconfig +++ b/config/Version.internal.xcconfig @@ -1,4 +1,4 @@ VERSION_SHORT=22.0 // Internal long version example: VERSION_LONG=9.9.0.20180423 -VERSION_LONG=22.0.0.20230324 +VERSION_LONG=22.0.0.20230329 diff --git a/config/Version.public.xcconfig b/config/Version.public.xcconfig index a26703b90ad1..ec716a58ec69 100644 --- a/config/Version.public.xcconfig +++ b/config/Version.public.xcconfig @@ -1,4 +1,4 @@ VERSION_SHORT=22.0 // Public long version example: VERSION_LONG=9.9.0.0 -VERSION_LONG=22.0.0.1 +VERSION_LONG=22.0.0.2