Skip to content

Commit

Permalink
Merge 'origin/trunk' into merge/release-22.1.0.2-into-trunk
Browse files Browse the repository at this point in the history
There were conflicts on `Podfile` and `Podfile.lock` because
`release/22.1` and `trunk` both changed the Gutenberg version.

As usual, I resolved them with `git checkout --theirs`, keeping the
value from `trunk` under the assumption that the latest version of
Gutenberg, 1.93.0-alpha2, is what `trunk` needs to work and that if the
1.92.1 hotfix hasn't already been integrated in the latest release, it
will be soon and the Gutenberg team will followup with a new version
update on `trunk`.

There was also a conflict on the `RELEASE-NOTES.txt` that GitHub picked
up with its more refined conflicts engine and that auto-merge didn't
address properly but that I manually fixed.

That was due to `release/22.1` adding new release note entries – which
will not make it into the App Store release notes – in the 22.1 section
and `trunk` having #20128 editing that section, too. #20128 was meant to
land on `release/22.1` but I forgot to update the base branch after
starting the code freeze 🤦‍♂️😭

```
<<<<<<< release/22.1 -- Incoming Change
* [**] Add a "Personalize Home Tab" button to the bottom of the Home tab that allows changing cards visibility. [#20369]
* [*] [Reader] Fix an issue that was causing the app to crash when tapping the More or Share buttons in Reader Detail screen. [#20490]
* [*] Block editor: Avoid empty Gallery block error [WordPress/gutenberg#49557]
=======
* [**] [internal] Refactored Google SignIn implementation to not use the Google SDK [#20128]
>>>>>>> trunk -- Current Change
```
  • Loading branch information
mokagio committed Apr 13, 2023
2 parents 25d5678 + ada2f7e commit c214ba2
Show file tree
Hide file tree
Showing 113 changed files with 2,355 additions and 499 deletions.
4 changes: 2 additions & 2 deletions .buildkite/cache-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.13.0
- automattic/git-s3-cache#v1.1.3:
- automattic/git-s3-cache#1.1.4:
bucket: "a8c-repo-mirrors"
repo: "wordpress-mobile/wordpress-ios/"
repo: "automattic/wordpress-ios/"
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.13.0
- automattic/git-s3-cache#v1.1.3:
- automattic/git-s3-cache#1.1.4:
bucket: "a8c-repo-mirrors"
repo: "wordpress-mobile/wordpress-ios/"
repo: "automattic/wordpress-ios/"
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.13.0
- automattic/git-s3-cache#v1.1.3:
- automattic/git-s3-cache#1.1.4:
bucket: "a8c-repo-mirrors"
repo: "wordpress-mobile/wordpress-ios/"
repo: "automattic/wordpress-ios/"
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
Expand Down
11 changes: 5 additions & 6 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def wordpress_ui
end

def wordpress_kit
pod 'WordPressKit', '~> 7.0.0-beta'
# pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: 'trunk'
pod 'WordPressKit', '~> 7.1.0-beta'
# 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', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: ''
# pod 'WordPressKit', path: '../WordPressKit-iOS'
Expand Down Expand Up @@ -91,7 +91,7 @@ def shared_style_pods
end

def gutenberg_pods
gutenberg tag: 'v1.92.1'
gutenberg tag: 'v1.93.0-alpha2'
end

def gutenberg(options)
Expand Down Expand Up @@ -142,7 +142,6 @@ def gutenberg_dependencies(options)
Yoga
RCT-Folly
glog
react-native-keyboard-aware-scroll-view
react-native-safe-area
react-native-safe-area-context
react-native-video
Expand Down Expand Up @@ -232,8 +231,8 @@ abstract_target 'Apps' do

pod 'Gridicons', '~> 1.1.0'

pod 'WordPressAuthenticator', '~> 5.6-beta'
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: 'trunk'
pod 'WordPressAuthenticator', '~> 6.0-beta'
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: ''
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', commit: ''
# pod 'WordPressAuthenticator', path: '../WordPressAuthenticator-iOS'

Expand Down
232 changes: 113 additions & 119 deletions Podfile.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
22.2
-----

* [**] [Jetpack-only] Added a dashboard card for purchasing domains. [#20424]
* [**] [internal] Refactored Google SignIn implementation to not use the Google SDK [#20128]

22.1
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ - (void)removeQuickStartFromBlog:(Blog *)blog sourceView:(UIView *)sourceView so
NSString *cancelTitle = NSLocalizedString(@"Cancel", @"Cancel button");

UIAlertController *removeConfirmation = [UIAlertController alertControllerWithTitle:removeTitle message:removeMessage preferredStyle:UIAlertControllerStyleAlert];
[removeConfirmation addCancelActionWithTitle:cancelTitle handler:^(UIAlertAction * _Nonnull action) {
[removeConfirmation addCancelActionWithTitle:cancelTitle handler:^(UIAlertAction * _Nonnull __unused action) {
[WPAnalytics trackQuickStartStat:WPAnalyticsStatQuickStartRemoveDialogButtonCancelTapped blog: blog];
[NoticesDispatch unlock];
}];
[removeConfirmation addDefaultActionWithTitle:confirmationTitle handler:^(UIAlertAction * _Nonnull action) {
[removeConfirmation addDefaultActionWithTitle:confirmationTitle handler:^(UIAlertAction * _Nonnull __unused action) {
[WPAnalytics trackQuickStartStat:WPAnalyticsStatQuickStartRemoveDialogButtonRemoveTapped blog: blog];
[[QuickStartTourGuide shared] removeFrom:blog];
[NoticesDispatch unlock];
Expand All @@ -27,10 +27,10 @@ - (void)removeQuickStartFromBlog:(Blog *)blog sourceView:(UIView *)sourceView so
UIAlertController *removeSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
removeSheet.popoverPresentationController.sourceView = sourceView;
removeSheet.popoverPresentationController.sourceRect = sourceRect;
[removeSheet addDestructiveActionWithTitle:removeTitle handler:^(UIAlertAction * _Nonnull action) {
[removeSheet addDestructiveActionWithTitle:removeTitle handler:^(UIAlertAction * _Nonnull __unused action) {
[self presentViewController:removeConfirmation animated:YES completion:nil];
}];
[removeSheet addCancelActionWithTitle:cancelTitle handler:^(UIAlertAction * _Nonnull action) {
[removeSheet addCancelActionWithTitle:cancelTitle handler:^(UIAlertAction * _Nonnull __unused action) {
[NoticesDispatch unlock];
}];

Expand Down
3 changes: 0 additions & 3 deletions WordPress/Classes/Models/WPAccount.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#import "WPAccount.h"
#import "WordPress-Swift.h"

static NSString * const WordPressComOAuthKeychainServiceName = @"public-api.wordpress.com";
static NSString * const JetpackComOAuthKeychainServiceName = @"jetpack.public-api.wordpress.com";

@interface WPAccount ()

@property (nonatomic, strong, readwrite) WordPressComRestApi *wordPressComRestApi;
Expand Down
4 changes: 2 additions & 2 deletions WordPress/Classes/Services/BlogService.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ - (void)syncBlogAndAllMetadata:(Blog *)blog completionHandler:(void (^)(void))co
dispatch_group_enter(syncGroup);
[editorService syncEditorSettingsForBlog:blog success:^{
dispatch_group_leave(syncGroup);
} failure:^(NSError * _Nonnull error) {
} failure:^(NSError * _Nonnull __unused error) {
DDLogError(@"Failed to sync Editor settings");
dispatch_group_leave(syncGroup);
}];
Expand Down Expand Up @@ -401,7 +401,7 @@ - (void)associateSyncedBlogsToJetpackAccount:(WPAccount *)account
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([Blog class])];
request.predicate = [NSPredicate predicateWithFormat:@"account = NULL"];
NSArray *blogs = [context executeFetchRequest:request error:nil];
blogs = [blogs filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
blogs = [blogs filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary * __unused bindings) {
Blog *blog = (Blog *)evaluatedObject;
NSNumber *jetpackBlogID = blog.jetpack.siteID;
return jetpackBlogID && [accountBlogIDs containsObject:jetpackBlogID];
Expand Down
5 changes: 1 addition & 4 deletions WordPress/Classes/Services/CommentService+Replies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ extension CommentService {
childComment.visibleOnReader = isVisible
}

self.coreDataStack.save(context)
DispatchQueue.main.async {
completion?()
}
self.coreDataStack.save(context, completion: completion, on: .main)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions WordPress/Classes/Services/CommentService.m
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ - (void)replyToCommentWithID:(NSNumber *)commentID
CommentServiceRemoteREST *remote = [self restRemoteForSite:siteID];
[remote replyToCommentWithID:commentID
content:content
success:^(RemoteComment *comment){
success:^(RemoteComment * __unused comment){
if (success){
success();
}
Expand Down Expand Up @@ -946,7 +946,7 @@ - (void)moderateComment:(Comment *)comment
id <CommentServiceRemote> remote = [self remoteForComment:comment];
RemoteComment *remoteComment = [self remoteCommentWithComment:comment];
[remote moderateComment:remoteComment
success:^(RemoteComment *comment) {
success:^(RemoteComment * __unused comment) {
if (success) {
success();
}
Expand Down
33 changes: 15 additions & 18 deletions WordPress/Classes/Services/MediaImportService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,15 @@ class MediaImportService: NSObject {
// HEIC isn't supported when uploading an image, so we filter it out (http://git.io/JJAae)
allowedFileTypes.remove("heic")

let completion: (Result<Media, Error>) -> Void = { result in
let completion: (Error?) -> Void = { error in
self.coreDataStack.performAndSave({ context in
let media = try context.existingObject(with: media.objectID) as! Media
switch result {
case let .success(media):
media.remoteStatus = .local
media.error = nil
case let .failure(error):
media.remoteStatus = .failed
media.error = error
let mediaInContext = try context.existingObject(with: media.objectID) as! Media
if let error {
mediaInContext.remoteStatus = .failed
mediaInContext.error = error
} else {
mediaInContext.remoteStatus = .local
mediaInContext.error = nil
}
}, completion: { result in
let transformed = result.flatMap {
Expand Down Expand Up @@ -237,7 +236,7 @@ class MediaImportService: NSObject {
///
/// - Returns: a progress object that report the current state of the import process.
///
private func `import`(_ exportable: ExportableAsset, to media: Media, allowableFileExtensions: Set<String>, completion: @escaping (Result<Media, Error>) -> Void) -> Progress {
private func `import`(_ exportable: ExportableAsset, to media: Media, allowableFileExtensions: Set<String>, completion: @escaping (Error?) -> Void) -> Progress {
let progress: Progress = Progress.discreteProgress(totalUnitCount: 1)
importQueue.async {
guard let exporter = self.makeExporter(for: exportable, allowableFileExtensions: allowableFileExtensions) else {
Expand All @@ -249,20 +248,18 @@ class MediaImportService: NSObject {
let mediaInContext = try context.existingObject(with: media.objectID) as! Media
self.configureMedia(mediaInContext, withExport: export)
}, completion: { result in
completion(
result.flatMap {
Result {
try self.coreDataStack.mainContext.existingObject(with: media.objectID) as! Media
}
}
)
if case let .failure(error) = result {
completion(error)
} else {
completion(nil)
}
}, on: .main)
},
onError: { error in
MediaImportService.logExportError(error)
// Return the error via the context's queue, and as an NSError to ensure it carries over the right code/message.
DispatchQueue.main.async {
completion(.failure(error))
completion(error)
}
}
)
Expand Down
6 changes: 3 additions & 3 deletions WordPress/Classes/Services/MediaService.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ - (void)updateMedia:(NSArray<Media *> *)mediaObjects
// This effectively ignores any errors presented
[self updateMedia:media success:^{
individualOperationCompletion(true);
} failure:^(NSError *error) {
} failure:^(NSError * __unused error) {
individualOperationCompletion(false);
}];
}
Expand Down Expand Up @@ -367,15 +367,15 @@ - (void)deleteMedia:(nonnull NSArray<Media *> *)mediaObjects

dispatch_group_t group = dispatch_group_create();

[mediaObjects enumerateObjectsUsingBlock:^(Media *media, NSUInteger idx, BOOL *stop) {
[mediaObjects enumerateObjectsUsingBlock:^(Media *media, NSUInteger __unused idx, BOOL * __unused stop) {
dispatch_group_enter(group);
[self deleteMedia:media success:^{
currentProgress.completedUnitCount++;
if (progress) {
progress(currentProgress);
}
dispatch_group_leave(group);
} failure:^(NSError *error) {
} failure:^(NSError * __unused error) {
dispatch_group_leave(group);
}];
}];
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Services/MediaThumbnailService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class MediaThumbnailService: NSObject {
return
}

let download = AuthenticatedImageDownload(url: imageURL, blog: media.blog, callbackQueue: callbackQueue, onSuccess: onCompletion, onFailure: onError)
let download = AuthenticatedImageDownload(url: imageURL, blogObjectID: media.blog.objectID, callbackQueue: callbackQueue, onSuccess: onCompletion, onFailure: onError)

download.start()
}
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Services/PostService.m
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ - (AutosaveFailureBlock)wrappedAutosaveFailureBlock:(AbstractPost *)post failure
- (AutosaveSuccessBlock)wrappedAutosaveSuccessBlock:(NSManagedObjectID *)postObjectID
success:(void (^)(AbstractPost *post, NSString *previewURL))success
{
return ^(RemotePost *post, NSString *previewURL) {
return ^(RemotePost *__unused post, NSString *previewURL) {
[self.managedObjectContext performBlock:^{
AbstractPost *postInContext = (AbstractPost *)[self.managedObjectContext existingObjectWithID:postObjectID error:nil];
if (postInContext) {
Expand Down
4 changes: 2 additions & 2 deletions WordPress/Classes/Services/ReaderSiteService.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ - (void)fetchTopicServiceWithID:(NSUInteger)siteID success:(void(^)(void))succes
ReaderTopicService *service = [[ReaderTopicService alloc] initWithCoreDataStack:self.coreDataStack];
[service siteTopicForSiteWithID:@(siteID)
isFeed:false
success:^(NSManagedObjectID *objectID, BOOL isFollowing) {
success:^(NSManagedObjectID * __unused objectID, BOOL __unused isFollowing) {
if (success) {
success();
}
Expand Down Expand Up @@ -224,7 +224,7 @@ - (void)followExistingSiteByURL:(NSURL *)siteURL success:(void (^)(void))success
} else {
[self followSiteAtURL:[siteURL absoluteString] success:success failure:failure];
}
} failure:^(NSError *error) {
} failure:^(NSError * __unused error) {
DDLogInfo(@"Could not find site at URL: %@", siteURL);
[self followSiteAtURL:[siteURL absoluteString] success:success failure:failure];
}];
Expand Down
10 changes: 5 additions & 5 deletions WordPress/Classes/Services/ReaderTopicService.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ - (void)deleteTopic:(ReaderAbstractTopic *)topic

- (void)preserveSavedPostsFromTopic:(ReaderAbstractTopic *)topic
{
[topic.posts enumerateObjectsUsingBlock:^(ReaderPost * _Nonnull post, NSUInteger idx, BOOL * _Nonnull stop) {
[topic.posts enumerateObjectsUsingBlock:^(ReaderPost * _Nonnull post, NSUInteger __unused idx, BOOL * _Nonnull __unused stop) {
if (post.isSavedForLater) {
DDLogInfo(@"Preserving saved post: %@", post.titleForDisplay);
post.topic = nil;
Expand Down Expand Up @@ -295,7 +295,7 @@ - (void)unfollowTag:(ReaderTagTopic *)topic withSuccess:(void (^)(void))success
return;
}

[remoteService unfollowTopicWithSlug:slug withSuccess:^(NSNumber *topicID) {
[remoteService unfollowTopicWithSlug:slug withSuccess:^(NSNumber * __unused topicID) {
successBlock();
} failure:^(NSError *error) {
if (failure) {
Expand Down Expand Up @@ -345,7 +345,7 @@ - (void)followTagWithSlug:(NSString *)slug withSuccess:(void (^)(void))success f
}

ReaderTopicServiceRemote *remoteService = [[ReaderTopicServiceRemote alloc] initWithWordPressComRestApi:[self apiForRequest]];
[remoteService followTopicWithSlug:slug withSuccess:^(NSNumber *topicID) {
[remoteService followTopicWithSlug:slug withSuccess:^(NSNumber * __unused topicID) {
successBlock();
} failure:^(NSError *error) {
if (failure) {
Expand Down Expand Up @@ -375,7 +375,7 @@ - (void)toggleFollowingForTag:(ReaderTagTopic *)tagTopic success:(void (^)(void)
BOOL oldShowInMenuValue = topic.showInMenu;

// Optimistically update and save
[self.coreDataStack performAndSaveUsingBlock:^(NSManagedObjectContext *context) {
[self.coreDataStack performAndSaveUsingBlock:^(NSManagedObjectContext * __unused context) {
ReaderTagTopic *topicInContext = (ReaderTagTopic *)[self.coreDataStack.mainContext existingObjectWithID:tagTopic.objectID error:nil];
topicInContext.following = !oldFollowingValue;
if (topicInContext.following) {
Expand All @@ -386,7 +386,7 @@ - (void)toggleFollowingForTag:(ReaderTagTopic *)tagTopic success:(void (^)(void)
// Define failure block
void (^failureBlock)(NSError *error) = ^void(NSError *error) {
// Revert changes on failure
[self.coreDataStack performAndSaveUsingBlock:^(NSManagedObjectContext *context) {
[self.coreDataStack performAndSaveUsingBlock:^(NSManagedObjectContext * __unused context) {
ReaderTagTopic *topicInContext = (ReaderTagTopic *)[self.coreDataStack.mainContext existingObjectWithID:tagTopic.objectID error:nil];
topicInContext.following = oldFollowingValue;
topicInContext.showInMenu = oldShowInMenuValue;
Expand Down
Loading

0 comments on commit c214ba2

Please sign in to comment.