profile
viewpoint
Paolo Musolino pmusolino Rome http://www.codeido.com I'm an iOS Software Engineer with more than 7 years of experience in the iOS platform. Heart and soul in every line of code.

dekatotoro/SlideMenuControllerSwift 3245

iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

Customerly/Customerly-iOS-SDK 13

Embed the Best-in-Class Live Chat for your iOS apps with Customerly Live Chat mobile SDK

Customerly/Android-SDK 8

Embed the Best-in-Class Live Chat for your Android apps with Customerly Live Chat mobile Android SDK

pmusolino/awesome-swift 3

A collaborative list of awesome swift resources. Feel free to contribute!

pmusolino/BitfinexMonitor 2

The app display a live BTC/USD order book from Bitfinex

Customerly/Customerly-ReactNative-SDK 1

Customerly SDK for integration in ReactNative app. See more at: https://www.customerly.io/

Customerly/customerly.github.io 1

https://www.customerly.io/

pmusolino/awesome-ios 1

A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

pmusolino/DWTagList 1

Create a list of tags from an NSArray to be show in a view with customisable fonts, colors etc.

pmusolino/iOS-Goodies 1

Your favorite iOS Newsletter, now open source.

PR opened woocommerce/woocommerce-ios

Products: the Limited Editing Available banner now it's more easy to tap Product List [Type] Bug

Fixes #2340

Description

The banner " Limited Editing Available" (now called New editing options available) on top of Product List it's not easy to expand. A user needs to tap exactly the small arrow on the right side. In this PR, now the entire banner become tappable.

Testing

  • Navigate to the product list.
  • Try to open and close the top banner tapping everywhere.

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+3 -1

0 comment

1 changed file

pr created time in 7 hours

Pull request review commentwoocommerce/woocommerce-ios

Add Tests for Proving and Documenting Possible Concurrency Issues

++import XCTest+import Storage+import Networking++@testable import Yosemite++/// Proofs and documentation for **possible** concurrency issues that we may run into in the future.+///+/// Currently, every Yosemite `Store` creates their own `StorageType` for background saving.+/// For example, in `OrderStore` and `ProductStore`, we declare them like this:+///+/// ```+/// private lazy var sharedDerivedStorage: StorageType = {+///     return storageManager.newDerivedStorage()+/// }()+/// ```+///+/// The `newDerivedStorage()` method typically creates a child `StorageType`+/// (`NSManagedObjectContext`). These children:+///+/// - Have no idea they have siblings (derived `StorageType` in other `Stores`)+/// - Do not see a siblings' data until a `saveIfNeeded()` is executed on that sibling.+///+/// This can mean that if two or more derived `StorageTypes` do similar things, it may be+/// possible to upsert the same records, leading to duplicate data. For example, in `OrderStore`, we+/// upsert records like this:+///+/// ```+/// // Fetch an existing record. If it doesn't exist, create a new one.+/// let storageOrder = storage.loadOrder(orderID: readOnlyOrder.orderID)+///             ?? storage.insertNewObject(ofType: Storage.Order.self)+///+/// // Update the new or existing record with the newly fetched data from the API+/// storageOrder.update(with: readOnlyOrder)+/// ```+///+/// If by coincidence, the same operation happens **at the same time** with the same order on a+/// **different** derived `StorageType`, we could be inserting the same order twice. And because we+/// currently don't have unique key constraints, two records would be saved in Core Data.+///+/// ## Is it a Problem?+///+/// This is probably not a problem at the moment. We are careful with using a single `StorageType`+/// for every `Store`. It would be a problem if:+///+/// - We have `Store` instances that are not deallocated, still running and doing something+///   in the background while another newly created `Store` is doing the same thing.+/// - The app grows and we need to do complex cross-feature operations. For example, saving+///   Products and Product Categories simultaneously as a single transaction.+///+final class StorageManagerConcurrencyTests: XCTestCase {++    private var storageManager: StorageManagerType!++    private var viewStorage: StorageType {+        storageManager.viewStorage+    }++    override func setUp() {+        super.setUp()+        // Use the Sqlite-based StorageManagerType to be closer to the production operations+        storageManager = CoreDataManager(name: "WooCommerce")+        storageManager.reset()+    }++    override func tearDown() {+        storageManager.reset()+        storageManager = nil+        super.tearDown()+    }++    /// Simulate what will happen if `perform()` happens at the same time but the `saveDerivedType`+    /// happens in sequence. We end up with the same record inserted twice.+    ///+    func testWhenSequentiallySavingItCanAllowSavingOfDuplicates() {+        // Given+        let firstDerivedStorage = storageManager.newDerivedStorage()+        let secondDerivedStorage = storageManager.newDerivedStorage()++        let orderStatus = Networking.OrderStatus(name: "In Space", siteID: 1_998, slug: "in-space", total: 9)++        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 0)++        // When+        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            derivedStorage.perform {+                self.upsert(orderStatus: orderStatus, using: derivedStorage)+            }+        }++        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            waitForExpectation { exp in+                storageManager.saveDerivedType(derivedStorage: derivedStorage) {+                    exp.fulfill()+                }+            }+        }++        // Then+        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 2)+    }++    /// Simulate what will happen if both the `perform()` and `saveDerivedType` happens at the+    /// same time. We end up with the same record inserted twice.+    ///+    func testWhenConcurrentlySavingItCanAllowSavingOfDuplicates() {+        // Given+        let firstDerivedStorage = storageManager.newDerivedStorage()+        let secondDerivedStorage = storageManager.newDerivedStorage()++        let orderStatus = Networking.OrderStatus(name: "In Space", siteID: 1_998, slug: "in-space", total: 9)++        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 0)++        // When+        let exp = expectation(description: "concurrent-saving")+        exp.expectedFulfillmentCount = 2++        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            derivedStorage.perform {+                self.upsert(orderStatus: orderStatus, using: derivedStorage)+            }++            self.storageManager.saveDerivedType(derivedStorage: derivedStorage) {

You are right 👍 I tried to introduce the persistentContainerQueue and I was able to verify this.

shiki

comment created time in 9 hours

Pull request review commentwoocommerce/woocommerce-ios

Add Tests for Proving and Documenting Possible Concurrency Issues

++import XCTest+import Storage+import Networking++@testable import Yosemite++/// Proofs and documentation for **possible** concurrency issues that we may run into in the future.+///+/// Currently, every Yosemite `Store` creates their own `StorageType` for background saving.+/// For example, in `OrderStore` and `ProductStore`, we declare them like this:+///+/// ```+/// private lazy var sharedDerivedStorage: StorageType = {+///     return storageManager.newDerivedStorage()+/// }()+/// ```+///+/// The `newDerivedStorage()` method typically creates a child `StorageType`+/// (`NSManagedObjectContext`). These children:+///+/// - Have no idea they have siblings (derived `StorageType` in other `Stores`)+/// - Do not see a siblings' data until a `saveIfNeeded()` is executed on that sibling.+///+/// This can mean that if two or more derived `StorageTypes` do similar things, it may be+/// possible to upsert the same records, leading to duplicate data. For example, in `OrderStore`, we+/// upsert records like this:+///+/// ```+/// // Fetch an existing record. If it doesn't exist, create a new one.+/// let storageOrder = storage.loadOrder(orderID: readOnlyOrder.orderID)+///             ?? storage.insertNewObject(ofType: Storage.Order.self)+///+/// // Update the new or existing record with the newly fetched data from the API+/// storageOrder.update(with: readOnlyOrder)+/// ```+///+/// If by coincidence, the same operation happens **at the same time** with the same order on a+/// **different** derived `StorageType`, we could be inserting the same order twice. And because we+/// currently don't have unique key constraints, two records would be saved in Core Data.+///+/// ## Is it a Problem?+///+/// This is probably not a problem at the moment. We are careful with using a single `StorageType`+/// for every `Store`. It would be a problem if:+///+/// - We have `Store` instances that are not deallocated, still running and doing something+///   in the background while another newly created `Store` is doing the same thing.+/// - The app grows and we need to do complex cross-feature operations. For example, saving+///   Products and Product Categories simultaneously as a single transaction.+///+final class StorageManagerConcurrencyTests: XCTestCase {++    private var storageManager: StorageManagerType!++    private var viewStorage: StorageType {+        storageManager.viewStorage+    }++    override func setUp() {+        super.setUp()+        // Use the Sqlite-based StorageManagerType to be closer to the production operations+        storageManager = CoreDataManager(name: "WooCommerce")+        storageManager.reset()

It's ok to keep it if it's a precaution 👍

shiki

comment created time in 9 hours

Pull request review commentwoocommerce/woocommerce-ios

Fix crash when uploading product images after logging in

 public class AlamofireNetwork: Network {     ///     public required init(credentials: Credentials) {         self.credentials = credentials-        let configuration = URLSessionConfiguration.background(withIdentifier: "com.automattic.woocommerce.backgroundsession")+        let uniqueID = UUID().uuidString+        let configuration = URLSessionConfiguration.background(withIdentifier: "com.automattic.woocommerce.backgroundsession.\(uniqueID)")

What do you think about adding here a small comment describing why we are using the uniqueID? I think it can be useful for the future

jaclync

comment created time in 11 hours

issue commentwoocommerce/woocommerce-ios

Crash selecting some images from the device photo library

@jaclync as you said, I was able to replicate it deleting the app from the simulator and reinstalling it, so every time I need to do the login, and accept the access to the iOS library. 👍

pmusolino

comment created time in 15 hours

issue closedwoocommerce/woocommerce-ios

Products: "Discard changes" prompt erroneously appears on Shipping

If I navigate to the Shipping screen of a Product, and I just press back, the Discard Changes action sheet is prompted, even though I haven't made any changes.

2020-05-22 14-46-10 2020-05-22 14_46_45

Environment:

  • Device: iPhone X
  • iOS version: 13.5
  • WooCommerce iOS version: 4.3

closed time in 15 hours

pmusolino

issue openedwoocommerce/woocommerce-ios

Products: the Limited Editing Available banner it's not easy to tap

The banner " Limited Editing Available" (now called New editing options available) on top of Product List it's not easy to expand. A user need to tap exactly the small arrow on the right side, the rest of the banner it's not tappable.

Expected result

Make the entire banner tappable.

Screenshots

<img src="https://user-images.githubusercontent.com/495617/82674181-3722f080-9c43-11ea-9fa8-cb38c268fb5e.png" width=300 />

Please include:

  • Device: iPhone X
  • iOS version: 13.5
  • WooCommerce iOS version: 4.3

WordPress Environment <details>

Copy and paste the system status report from **WooCommerce > System Status** in WordPress admin.

</details>

created time in 3 days

issue openedwoocommerce/woocommerce-ios

Products: the offset of the images collection view after selecting some images to upload is wrong

Going back to products after choosing some images to upload, the collection view offset will be maintained where the "+" button is, but I was expecting to see the collection view offset set to 0 where the first cell is showed and where the user can see the new images upload which is in progress.

GIF

<img src="https://user-images.githubusercontent.com/495617/82672364-903d5500-9c40-11ea-84ac-e0f27d7343c1.gif" width=300 />

Mobile Environment

  • Device: iPhone X simulator
  • iOS version: 4.3
  • WooCommerce iOS version: 13.4

created time in 3 days

issue commentwoocommerce/woocommerce-ios

Crash selecting some images from the device photo library

Following the same steps (also on different products) and making sure that the alert to give the authorization to access the photo library appears, I can reproduce the crash systematically. Schermata 2020-05-22 alle 15 15 14

Terminating app due to uncaught exception 'NSGenericException', reason: 'Task created in a session that has been invalidated'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23e3dcce __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff50b3b9b2 objc_exception_throw + 48
	2   CFNetwork                           0x00007fff22ffdb92 cfnTranslateCFError + 23986
	3   CFNetwork                           0x00007fff230038ad cfnTranslateCFError + 47821
	4   CFNetwork                           0x00007fff230039dc cfnTranslateCFError + 48124
	5   libdispatch.dylib                   0x0000000112644e8e _dispatch_client_callout + 8
	6   libdispatch.dylib                   0x0000000112653ae2 _dispatch_lane_barrier_sync_invoke_and_complete + 132
	7   CFNetwork                           0x00007fff22ffd086 cfnTranslateCFError + 21158
	8   CFNetwork                           0x00007fff22ffd706 cfnTranslateCFError + 22822
	9   Alamofire                           0x000000010ee34cda $s9Alamofire13UploadRequestC10UploadableO4task7session7adapter5queueSo16NSURLSessionTaskCSo0I0C_AA0C7Adapter_pSgSo012OS_dispatch_H0CtKFSo0ibJ0CyXEfU0_ + 330
	10  Alamofire                           0x000000010ee34b43 $sSo22NSURLSessionUploadTaskCs5Error_pIgozo_ABsAC_pIegrzo_TR + 19
	11  Alamofire                           0x000000010ee34ea4 $sSo22NSURLSessionUploadTaskCs5Error_pIgozo_ABsAC_pIegrzo_TRTA.5 + 20
	12  libswiftDispatch.dylib              0x0000000112247251 $sxs5Error_pIgrzo_xsAA_pIegrzo_lTRTA + 17
	13  libswiftDispatch.dylib              0x000000011223f684 $sSo17OS_dispatch_queueC8DispatchE11_syncHelper33_F417D752D2C4E9330E1C700411CE0C6ALL2fn7execute6rescuexyyyXEXE_xyKXExs5Error_pKXEtKlFyxyKcXEfU_yyXEfU_ + 84
	14  libswiftDispatch.dylib              0x0000000112247071 $sIg_Ieg_TRTA + 17
	15  libswiftDispatch.dylib              0x000000011223a6de $sIeg_IyB_TR + 14
	16  libdispatch.dylib                   0x0000000112644e8e _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x0000000112653ae2 _dispatch_lane_barrier_sync_invoke_and_complete + 132
	18  libswiftDispatch.dylib              0x000000011223fc06 $sSo17OS_dispatch_queueC4sync7executeyyyXE_tFTO + 150
	19  libswiftDispatch.dylib              0x0000000112244390 $sSo17OS_dispatch_queueC4sync7executeyyyXE_tFTOTA + 16
	20  libswiftDispatch.dylib              0x000000011223f55c $sSo17OS_dispatch_queueC8DispatchE11_syncHelper33_F417D752D2C4E9330E1C700411CE0C6ALL2fn7execute6rescuexyyyXEXE_xyKXExs5Error_pKXEtKlF + 252
	21  libswiftDispatch.dylib              0x000000011223fb46 $sSo17OS_dispatch_queueC8DispatchE4sync7executexxyKXE_tKlF + 118
	22  Alamofire                           0x000000010ee33f56 $s9Alamofire13UploadRequestC10UploadableO4task7session7adapter5queueSo16NSURLSessionTaskCSo0I0C_AA0C7Adapter_pSgSo012OS_dispatch_H0CtKF + 1766
	23  Alamofire                           0x000000010ee7d0d0 $s9Alamofire14SessionManagerC6upload33_83E574FCF6E88D5939C6CCAC18E76758LLyAA13UploadRequestCAG10UploadableOF + 384
	24  Alamofire                           0x000000010ee78a17 $s9Alamofire14SessionManagerC6upload_4withAA13UploadRequestC10Foundation3URLV_AA21URLRequestConvertible_ptF + 807
	25  Alamofire                           0x000000010ee7b8b5 $s9Alamofire14SessionManagerC6upload17multipartFormData14usingThreshold4with5queue18encodingCompletionyyAA09MultipartfG0Cc_s6UInt64VAA21URLRequestConvertible_pSo012OS_dispatch_K0CSgyAC0nfG14EncodingResultOcSgtFyycfU_ + 4821
	26  Alamofire                           0x000000010ee7dfb7 $s9Alamofire14SessionManagerC6upload17multipartFormData14usingThreshold4with5queue18encodingCompletionyyAA09MultipartfG0Cc_s6UInt64VAA21URLRequestConvertible_pSo012OS_dispatch_K0CSgyAC0nfG14EncodingResultOcSgtFyycfU_TA + 55
	27  Alamofire                           0x000000010ee08540 $sIeg_IeyB_TR + 48
	28  libdispatch.dylib                   0x0000000112643f11 _dispatch_call_block_and_release + 12
	29  libdispatch.dylib                   0x0000000112644e8e _dispatch_client_callout + 8
	30  libdispatch.dylib                   0x000000011265656d _dispatch_root_queue_drain + 819
	31  libdispatch.dylib                   0x0000000112656ca6 _dispatch_worker_thread2 + 135
	32  libsystem_pthread.dylib             0x00007fff51b9e9f7 _pthread_wqthread + 220
	33  libsystem_pthread.dylib             0x00007fff51b9db77 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException
pmusolino

comment created time in 3 days

issue openedwoocommerce/woocommerce-ios

Crash selecting some images from the device photo library

While I was recording a video while I was reporting another issue on Product Images, I encountered a crash while I was selecting some images from the device photo library.

The attached gif shows the whole process and the crash. image selection crash

Environment

  • Device: iPhone 11 Pro (simulator)
  • iOS version: 13.4
  • WooCommerce iOS version: 4.3

created time in 3 days

issue openedwoocommerce/woocommerce-ios

Products: "Discard changes" prompt erroneously appears on Shipping

If I navigate to the Shipping screen of a Product, and I just press back, the Discard Changes action sheet is prompted, even though I haven't made any changes.

2020-05-22 14-46-10 2020-05-22 14_46_45

Environment:

  • Device: iPhone X
  • iOS version: 13.5
  • WooCommerce iOS version: 4.3

created time in 3 days

Pull request review commentwoocommerce/woocommerce-ios

Add Tests for Proving and Documenting Possible Concurrency Issues

++import XCTest+import Storage+import Networking++@testable import Yosemite++/// Proofs and documentation for **possible** concurrency issues that we may run into in the future.+///+/// Currently, every Yosemite `Store` creates their own `StorageType` for background saving.+/// For example, in `OrderStore` and `ProductStore`, we declare them like this:+///+/// ```+/// private lazy var sharedDerivedStorage: StorageType = {+///     return storageManager.newDerivedStorage()+/// }()+/// ```+///+/// The `newDerivedStorage()` method typically creates a child `StorageType`+/// (`NSManagedObjectContext`). These children:+///+/// - Have no idea they have siblings (derived `StorageType` in other `Stores`)+/// - Do not see a siblings' data until a `saveIfNeeded()` is executed on that sibling.+///+/// This can mean that if two or more derived `StorageTypes` do similar things, it may be+/// possible to upsert the same records, leading to duplicate data. For example, in `OrderStore`, we+/// upsert records like this:+///+/// ```+/// // Fetch an existing record. If it doesn't exist, create a new one.+/// let storageOrder = storage.loadOrder(orderID: readOnlyOrder.orderID)+///             ?? storage.insertNewObject(ofType: Storage.Order.self)+///+/// // Update the new or existing record with the newly fetched data from the API+/// storageOrder.update(with: readOnlyOrder)+/// ```+///+/// If by coincidence, the same operation happens **at the same time** with the same order on a+/// **different** derived `StorageType`, we could be inserting the same order twice. And because we+/// currently don't have unique key constraints, two records would be saved in Core Data.+///+/// ## Is it a Problem?+///+/// This is probably not a problem at the moment. We are careful with using a single `StorageType`+/// for every `Store`. It would be a problem if:+///+/// - We have `Store` instances that are not deallocated, still running and doing something+///   in the background while another newly created `Store` is doing the same thing.+/// - The app grows and we need to do complex cross-feature operations. For example, saving+///   Products and Product Categories simultaneously as a single transaction.+///+final class StorageManagerConcurrencyTests: XCTestCase {++    private var storageManager: StorageManagerType!++    private var viewStorage: StorageType {+        storageManager.viewStorage+    }++    override func setUp() {+        super.setUp()+        // Use the Sqlite-based StorageManagerType to be closer to the production operations+        storageManager = CoreDataManager(name: "WooCommerce")+        storageManager.reset()+    }++    override func tearDown() {+        storageManager.reset()+        storageManager = nil+        super.tearDown()+    }++    /// Simulate what will happen if `perform()` happens at the same time but the `saveDerivedType`+    /// happens in sequence. We end up with the same record inserted twice.+    ///+    func testWhenSequentiallySavingItCanAllowSavingOfDuplicates() {+        // Given+        let firstDerivedStorage = storageManager.newDerivedStorage()+        let secondDerivedStorage = storageManager.newDerivedStorage()++        let orderStatus = Networking.OrderStatus(name: "In Space", siteID: 1_998, slug: "in-space", total: 9)++        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 0)++        // When+        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            derivedStorage.perform {+                self.upsert(orderStatus: orderStatus, using: derivedStorage)+            }+        }++        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            waitForExpectation { exp in+                storageManager.saveDerivedType(derivedStorage: derivedStorage) {+                    exp.fulfill()+                }+            }+        }++        // Then+        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 2)+    }++    /// Simulate what will happen if both the `perform()` and `saveDerivedType` happens at the+    /// same time. We end up with the same record inserted twice.+    ///+    func testWhenConcurrentlySavingItCanAllowSavingOfDuplicates() {+        // Given+        let firstDerivedStorage = storageManager.newDerivedStorage()+        let secondDerivedStorage = storageManager.newDerivedStorage()++        let orderStatus = Networking.OrderStatus(name: "In Space", siteID: 1_998, slug: "in-space", total: 9)++        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 0)++        // When+        let exp = expectation(description: "concurrent-saving")+        exp.expectedFulfillmentCount = 2++        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            derivedStorage.perform {+                self.upsert(orderStatus: orderStatus, using: derivedStorage)+            }++            self.storageManager.saveDerivedType(derivedStorage: derivedStorage) {+                exp.fulfill()+            }+        }++        wait(for: [exp], timeout: Constants.expectationTimeout)++        // Then+        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 2)+    }++    /// Simulate what will happen if `perform()` and `saveDerivedType` called under a single+    /// `perform()` block happens at the same time on two `StorageTypes`. We end up with the same+    /// record inserted twice.+    ///+    func testWhenConcurrentlySavingUsingASinglePerformBlockItCanAllowSavingOfDuplicates() {+        // Given+        let firstDerivedStorage = storageManager.newDerivedStorage()+        let secondDerivedStorage = storageManager.newDerivedStorage()++        let orderStatus = Networking.OrderStatus(name: "In Space", siteID: 1_998, slug: "in-space", total: 9)++        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 0)++        // When+        let exp = expectation(description: "concurrent-saving")+        exp.expectedFulfillmentCount = 2++        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            derivedStorage.perform {+                self.upsert(orderStatus: orderStatus, using: derivedStorage)++                self.storageManager.saveDerivedType(derivedStorage: derivedStorage) {

Here the sequence it's correct: you call saveDerivedType immediately after the upsert, and both are inside the perform block.

shiki

comment created time in 4 days

Pull request review commentwoocommerce/woocommerce-ios

Add Tests for Proving and Documenting Possible Concurrency Issues

++import XCTest+import Storage+import Networking++@testable import Yosemite++/// Proofs and documentation for **possible** concurrency issues that we may run into in the future.+///+/// Currently, every Yosemite `Store` creates their own `StorageType` for background saving.+/// For example, in `OrderStore` and `ProductStore`, we declare them like this:+///+/// ```+/// private lazy var sharedDerivedStorage: StorageType = {+///     return storageManager.newDerivedStorage()+/// }()+/// ```+///+/// The `newDerivedStorage()` method typically creates a child `StorageType`+/// (`NSManagedObjectContext`). These children:+///+/// - Have no idea they have siblings (derived `StorageType` in other `Stores`)+/// - Do not see a siblings' data until a `saveIfNeeded()` is executed on that sibling.+///+/// This can mean that if two or more derived `StorageTypes` do similar things, it may be+/// possible to upsert the same records, leading to duplicate data. For example, in `OrderStore`, we+/// upsert records like this:+///+/// ```+/// // Fetch an existing record. If it doesn't exist, create a new one.+/// let storageOrder = storage.loadOrder(orderID: readOnlyOrder.orderID)+///             ?? storage.insertNewObject(ofType: Storage.Order.self)+///+/// // Update the new or existing record with the newly fetched data from the API+/// storageOrder.update(with: readOnlyOrder)+/// ```+///+/// If by coincidence, the same operation happens **at the same time** with the same order on a+/// **different** derived `StorageType`, we could be inserting the same order twice. And because we+/// currently don't have unique key constraints, two records would be saved in Core Data.+///+/// ## Is it a Problem?+///+/// This is probably not a problem at the moment. We are careful with using a single `StorageType`+/// for every `Store`. It would be a problem if:+///+/// - We have `Store` instances that are not deallocated, still running and doing something+///   in the background while another newly created `Store` is doing the same thing.+/// - The app grows and we need to do complex cross-feature operations. For example, saving+///   Products and Product Categories simultaneously as a single transaction.+///+final class StorageManagerConcurrencyTests: XCTestCase {++    private var storageManager: StorageManagerType!++    private var viewStorage: StorageType {+        storageManager.viewStorage+    }++    override func setUp() {+        super.setUp()+        // Use the Sqlite-based StorageManagerType to be closer to the production operations+        storageManager = CoreDataManager(name: "WooCommerce")+        storageManager.reset()+    }++    override func tearDown() {+        storageManager.reset()+        storageManager = nil+        super.tearDown()+    }++    /// Simulate what will happen if `perform()` happens at the same time but the `saveDerivedType`+    /// happens in sequence. We end up with the same record inserted twice.+    ///+    func testWhenSequentiallySavingItCanAllowSavingOfDuplicates() {+        // Given+        let firstDerivedStorage = storageManager.newDerivedStorage()+        let secondDerivedStorage = storageManager.newDerivedStorage()++        let orderStatus = Networking.OrderStatus(name: "In Space", siteID: 1_998, slug: "in-space", total: 9)++        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 0)++        // When+        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            derivedStorage.perform {+                self.upsert(orderStatus: orderStatus, using: derivedStorage)+            }+        }++        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            waitForExpectation { exp in+                storageManager.saveDerivedType(derivedStorage: derivedStorage) {+                    exp.fulfill()+                }+            }+        }++        // Then+        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 2)+    }++    /// Simulate what will happen if both the `perform()` and `saveDerivedType` happens at the+    /// same time. We end up with the same record inserted twice.+    ///+    func testWhenConcurrentlySavingItCanAllowSavingOfDuplicates() {+        // Given+        let firstDerivedStorage = storageManager.newDerivedStorage()+        let secondDerivedStorage = storageManager.newDerivedStorage()++        let orderStatus = Networking.OrderStatus(name: "In Space", siteID: 1_998, slug: "in-space", total: 9)++        XCTAssertEqual(viewStorage.countObjects(ofType: Storage.OrderStatus.self), 0)++        // When+        let exp = expectation(description: "concurrent-saving")+        exp.expectedFulfillmentCount = 2++        [firstDerivedStorage, secondDerivedStorage].forEach { derivedStorage in+            derivedStorage.perform {+                self.upsert(orderStatus: orderStatus, using: derivedStorage)+            }++            self.storageManager.saveDerivedType(derivedStorage: derivedStorage) {

I think this can result in strange behaviors if it's done immediately after the derivedStorage.perform, since perform asynchronously performs a given block on the StorageType's queue. I believe this is also the reason why on my tests p91TBi-2ND here, I obtained 0 objects and not 2. Probably self.storageManager.saveDerivedType(derivedStorage: derivedStorage) it's called before the upsert.

shiki

comment created time in 4 days

Pull request review commentwoocommerce/woocommerce-ios

Add Tests for Proving and Documenting Possible Concurrency Issues

++import XCTest+import Storage+import Networking++@testable import Yosemite++/// Proofs and documentation for **possible** concurrency issues that we may run into in the future.

I think that a mention that in the future we want these tests failing can be a good reminder, since these tests show that there is a behavior that we do not expect, unlike all the other tests where a green tick is what we are looking for 👍

shiki

comment created time in 4 days

Pull request review commentwoocommerce/woocommerce-ios

Add Tests for Proving and Documenting Possible Concurrency Issues

++import XCTest+import Storage+import Networking++@testable import Yosemite++/// Proofs and documentation for **possible** concurrency issues that we may run into in the future.+///+/// Currently, every Yosemite `Store` creates their own `StorageType` for background saving.+/// For example, in `OrderStore` and `ProductStore`, we declare them like this:+///+/// ```+/// private lazy var sharedDerivedStorage: StorageType = {+///     return storageManager.newDerivedStorage()+/// }()+/// ```+///+/// The `newDerivedStorage()` method typically creates a child `StorageType`+/// (`NSManagedObjectContext`). These children:+///+/// - Have no idea they have siblings (derived `StorageType` in other `Stores`)+/// - Do not see a siblings' data until a `saveIfNeeded()` is executed on that sibling.+///+/// This can mean that if two or more derived `StorageTypes` do similar things, it may be+/// possible to upsert the same records, leading to duplicate data. For example, in `OrderStore`, we+/// upsert records like this:+///+/// ```+/// // Fetch an existing record. If it doesn't exist, create a new one.+/// let storageOrder = storage.loadOrder(orderID: readOnlyOrder.orderID)+///             ?? storage.insertNewObject(ofType: Storage.Order.self)+///+/// // Update the new or existing record with the newly fetched data from the API+/// storageOrder.update(with: readOnlyOrder)+/// ```+///+/// If by coincidence, the same operation happens **at the same time** with the same order on a+/// **different** derived `StorageType`, we could be inserting the same order twice. And because we+/// currently don't have unique key constraints, two records would be saved in Core Data.+///+/// ## Is it a Problem?+///+/// This is probably not a problem at the moment. We are careful with using a single `StorageType`+/// for every `Store`. It would be a problem if:+///+/// - We have `Store` instances that are not deallocated, still running and doing something+///   in the background while another newly created `Store` is doing the same thing.+/// - The app grows and we need to do complex cross-feature operations. For example, saving+///   Products and Product Categories simultaneously as a single transaction.+///+final class StorageManagerConcurrencyTests: XCTestCase {++    private var storageManager: StorageManagerType!++    private var viewStorage: StorageType {+        storageManager.viewStorage+    }++    override func setUp() {+        super.setUp()+        // Use the Sqlite-based StorageManagerType to be closer to the production operations+        storageManager = CoreDataManager(name: "WooCommerce")+        storageManager.reset()

do we really need to call reset() here?

shiki

comment created time in 4 days

issue commentwoocommerce/woocommerce-ios

Products: Trying to view a draft product on the store leads to 404 error

Good catch @rachelmcr. We need to hide the option View product on store when the product is on a status different from "published".

rachelmcr

comment created time in 4 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha f85c43f3d97644a9aa3a90745e7a8e67fce2c893

fix: FileStorageTests URLs that never exists

view details

Paolo Musolino

commit sha 491c32197db41beb6b2c522de0ecbc1f1f7ad0ba

refactor: moved URL under a class variable.

view details

Paolo Musolino

commit sha f7b7c620b609131d4535323f464fc37ab5d758f2

Fix: Hound CI warning

view details

Paolo Musolino

commit sha 472adfa9709b6d1f36304c2d64c77cfe20680879

Merge pull request #2330 from woocommerce/fix/file-storage-tests Improvement to FileStorageTests: managed URLs that never exists

view details

push time in 4 days

PR merged woocommerce/woocommerce-ios

Improvement to FileStorageTests: managed URLs that never exists Tech Debt Unit Tests

Part of #1687. Discussions started here https://github.com/woocommerce/woocommerce-ios/pull/1672#issuecomment-569953807 and here https://github.com/woocommerce/woocommerce-ios/pull/2318#discussion_r427922592

Since URLs are the preferred way to refer to local files, but also to external resources, I modified how FileStorageTests manage non-existing URLs, pointing to a non-existing path. Previously, a URL that points to a nonexisting website in some cases will be rendered because locally the router redirects us to the web page of the internet provider (after the redirect, the website exist and there is a file to download, so tests fail).

Testing

  • Just CI
  • Look at the code

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+5 -8

0 comment

1 changed file

pmusolino

pr closed time in 4 days

Pull request review commentwoocommerce/woocommerce-ios

Update PList storage implementation

 final class FileStorageTests: XCTestCase {     }      func testFileIsLoaded() {-        XCTAssertNoThrow(try subject?.data(for: fileURL!))+        var data: [PreselectedProvider]?+        XCTAssertNoThrow(data = try subject?.data(for: fileURL!))+        XCTAssertNotNil(data)     }      func testErrorIsTriggeredWhenFileFailsToLoad() {         let url = URL(string: "http://somewhere.on.the.internet")

Thanks @jaclync for finding the links! I opened a proposal here: https://github.com/woocommerce/woocommerce-ios/pull/2330 I think in this way tests always work locally.

jaclync

comment created time in 4 days

PR opened woocommerce/woocommerce-ios

Improvement to FileStorageTests: managed URLs that never exists Tech Debt Unit Tests

Part of #1687. Discussions started here https://github.com/woocommerce/woocommerce-ios/pull/1672#issuecomment-569953807 and here https://github.com/woocommerce/woocommerce-ios/pull/2318#discussion_r427922592

Since URLs are the preferred way to refer to local files, but also to external resources, I modified how FileStorageTests manage non-existing URLs, pointing to a non-existing path. Previously, a URL that points to a nonexisting website in some cases will be rendered because locally the router redirects us to the web page of the internet provider (after the redirect, the website exist and there is a file to download, so tests fail).

Testing

  • Just CI
  • Look at the code

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+5 -8

0 comment

1 changed file

pr created time in 4 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha f7b7c620b609131d4535323f464fc37ab5d758f2

Fix: Hound CI warning

view details

push time in 4 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 491c32197db41beb6b2c522de0ecbc1f1f7ad0ba

refactor: moved URL under a class variable.

view details

push time in 4 days

create barnchwoocommerce/woocommerce-ios

branch : fix/file-storage-tests

created branch time in 4 days

issue closedwoocommerce/woocommerce-ios

TitleAndEditableValueTableViewCell constraints errors

Looking at our TitleAndEditableValueTableViewCell xib, seems that our constraints are broken, and they are easily fixable.

Schermata 2020-05-08 alle 11 33 11

closed time in 4 days

pmusolino

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 8044d5ec0b3debac6ac0d4cc5723b8128c1624a2

Renamed TitleAndEditableValueTableViewCellTests file

view details

Paolo Musolino

commit sha 9bd10fcac31a49fc6beeb263cf1a1cfdcf453e7a

fixed TitleAndEditableValueTableViewCell constraints, adding an UIStackView

view details

Paolo Musolino

commit sha df312e24459e25a3fb0c9844f88901f5cad261d2

fix: spacing between label and text field

view details

Paolo Musolino

commit sha 24fef53a699dddb37a05dc85b2de46768c36a88f

fix: cell spacing setup in code

view details

Paolo Musolino

commit sha 4ef12a9b22bed5ed4684deda94331e682dae008f

Merge pull request #2323 from woocommerce/issue/2259-TitleAndEditableValueTableViewCell-constraints-error Fixed TitleAndEditableValueTableViewCell constraints errors

view details

push time in 4 days

PR merged woocommerce/woocommerce-ios

Fixed TitleAndEditableValueTableViewCell constraints errors Tech Debt [Type] Bug

Fixes #2259

Changes

  • Fixed constraints in TitleAndEditableValueTableViewCell that now use a vertical UIStackView.
  • Renamed the EditableValueOneTableViewCellTests file, which containts the TitleAndEditableValueTableViewCell tests.

New setup: Schermata 2020-05-20 alle 19 28 47

Testing

  1. Navigate to an order detail, and try to add a shipping tracking.
  2. Make sure that the appearance is like before.

<img src="https://user-images.githubusercontent.com/495617/82478474-3ff3b500-9ad1-11ea-9f0e-e28a915a8a79.png" width=300 />

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+45 -30

3 comments

4 changed files

pmusolino

pr closed time in 4 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 5917d7fd7d10baa26ac5ab480383e360b68156f8

fix: shipping method HTML is now decoded

view details

Paolo Musolino

commit sha d243b526fdfa98187765ae2ef8ad353807e620d5

feat: updated RELEASE-NOTES

view details

Paolo Musolino

commit sha 4ed4e006b269cd34a7c3406ae77d8dbf97126272

Merge pull request #2327 from woocommerce/issue/1873-fixed-shipping-method-html-not-decoded Order Details: HTML in the shipping method is now decoded

view details

push time in 4 days

PR merged woocommerce/woocommerce-ios

Order Details: HTML in the shipping method is now decoded Order Details [Type] Bug

Fixes #1873

Description

When a shipping method In Order Detail and Order Fulfillment contains something commonly escaped in HTML (like an ampersand &) it's showing up as an HTML entity.

Testing

  • Open an Order Detail, with a shipping method which contains HTML -> Now should show the correct string.
  • Open an Order Fulfillment, with a shipping method which contains HTML -> Now should show the correct string.

<img src="https://user-images.githubusercontent.com/495617/82548939-70ccfc00-9b5c-11ea-9e11-600012c9a5c5.png" width=300 />

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+7 -2

0 comment

3 changed files

pmusolino

pr closed time in 4 days

issue closedwoocommerce/woocommerce-ios

Order Details: HTML in the shipping method is not decoded

Describe the bug

Similar to https://github.com/woocommerce/woocommerce-ios/issues/1808 and https://github.com/woocommerce/woocommerce-ios/issues/1871, we probably want to decode the HTML in the shipping method data from the API.

To Reproduce

Prerequisite: Create an order with a shipping method that contains some special characters (e.g. "Priority Mail Flat Rate®")

  • Go to the Orders tab
  • Tap on the Order that was created in the prerequisite step
  • Note the shipping method field under CUSTOMER > Shipping Method

Screenshots

<img src="https://user-images.githubusercontent.com/1945542/74634014-faf07780-519d-11ea-9f97-788876e87548.PNG" width="320" />

Expected behavior A clear and concise description of what you expected to happen.

Isolating the problem (mark completed items with an [x]):

  • [ ] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • [ ] This bug happens with a default WordPress theme active, or Storefront.
  • [x] I can reproduce this bug consistently using the steps above.

Mobile Environment Please include:

  • Device: any
  • iOS version: iOS 12.1/13.3
  • WooCommerce iOS version: 3.6.0.2

closed time in 4 days

jaclync

Pull request review commentwoocommerce/woocommerce-ios

Fixed TitleAndEditableValueTableViewCell constraints errors

 <?xml version="1.0" encoding="UTF-8"?>-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">-    <device id="retina4_7" orientation="portrait">-        <adaptation id="fullscreen"/>-    </device>+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">+    <device id="retina4_7" orientation="portrait" appearance="light"/>     <dependencies>         <deployment identifier="iOS"/>-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>     </dependencies>     <objects>         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>         <tableViewCell contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="74" id="KGk-i7-Jjw" customClass="TitleAndEditableValueTableViewCell" customModule="WooCommerce" customModuleProvider="target">-            <rect key="frame" x="0.0" y="0.0" width="320" height="74"/>+            <rect key="frame" x="0.0" y="0.0" width="320" height="75"/>             <autoresizingMask key="autoresizingMask"/>             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">-                <rect key="frame" x="0.0" y="0.0" width="320" height="73.5"/>+                <rect key="frame" x="0.0" y="0.0" width="320" height="75"/>                 <autoresizingMask key="autoresizingMask"/>                 <subviews>-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tkk-vL-bFn">-                        <rect key="frame" x="16" y="16" width="288" height="20.5"/>-                        <fontDescription key="fontDescription" type="system" pointSize="17"/>-                        <nil key="textColor"/>-                        <nil key="highlightedColor"/>-                    </label>-                    <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="6kq-Y6-uD9">-                        <rect key="frame" x="16" y="43.5" width="288" height="17"/>-                        <nil key="textColor"/>-                        <fontDescription key="fontDescription" type="system" pointSize="14"/>-                        <textInputTraits key="textInputTraits"/>-                    </textField>+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="eaj-fO-0Qx">

I totally agree with you. I made the change here 24fef53a699dddb37a05dc85b2de46768c36a88f 🙇‍♂️

pmusolino

comment created time in 4 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 24fef53a699dddb37a05dc85b2de46768c36a88f

fix: cell spacing setup in code

view details

push time in 4 days

issue commentwoocommerce/woocommerce-ios

Order Details: shipping address is flipped

@jaclync I checked this bug and I'm not able to replicate it from the device or from the simulator. Can you retry it on the same order? Probably it was fixed

This is a screenshots from a read device (iPhone X): <img src="https://user-images.githubusercontent.com/495617/82572413-90781a80-9b84-11ea-85fe-bab26824bc1d.jpeg" width=300 />

jaclync

comment created time in 4 days

PR opened woocommerce/woocommerce-ios

Order Details: HTML in the shipping method is now decoded Order Details [Type] Bug

Fixes #1873

Description

When a shipping method In Order Detail and Order Fulfillment contains something commonly escaped in HTML (like an ampersand &) it's showing up as an HTML entity.

Testing

  • Open an Order Detail, with a shipping method which contains HTML -> Now should show the correct string.
  • Open an Order Fulfillment, with a shipping method which contains HTML -> Now should show the correct string.

<img src="https://user-images.githubusercontent.com/495617/82548939-70ccfc00-9b5c-11ea-9e11-600012c9a5c5.png" width=300 />

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+7 -2

0 comment

3 changed files

pr created time in 5 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha d243b526fdfa98187765ae2ef8ad353807e620d5

feat: updated RELEASE-NOTES

view details

push time in 5 days

pull request commentwoocommerce/woocommerce-ios

Fixed TitleAndEditableValueTableViewCell constraints errors

@jaclync good catch! Fixed here df312e24459e25a3fb0c9844f88901f5cad261d2

pmusolino

comment created time in 5 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha df312e24459e25a3fb0c9844f88901f5cad261d2

fix: spacing between label and text field

view details

push time in 5 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 7a410ab16036e3acf8d7059b10b38cad4cd8352b

Fixed constraints in InProgressViewController

view details

Paolo Musolino

commit sha eec8ec29b4cfc8e215ecd1550d6f5ee434d07dcd

Merge pull request #2324 from woocommerce/issue/2133-fixed-constraints-InProgressViewController Fixed constraints in InProgressViewController

view details

push time in 5 days

PR merged woocommerce/woocommerce-ios

Fixed constraints in InProgressViewController Add/Edit Products [Type] Bug

Fixes #2133

This PR fixes some auto layout warnings that appear when the InProgressViewController was presented.

Testing

  • Try to update a simple product.
  • When the progress view appears, make sure that everything is like before, and you don't have any warning related to this view.

<img src="https://user-images.githubusercontent.com/495617/82481170-35d3b580-9ad5-11ea-8239-6e94a57ff606.png" width=300 />

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+25 -33

1 comment

1 changed file

pmusolino

pr closed time in 5 days

issue closedwoocommerce/woocommerce-ios

Autolayout issues on InProgressViewController

When the product update progress view is showed, I see these logs on the Xcode console, about some Autolayout issues in the InProgressViewController.

Logs

2020-04-13 16:44:03.194052+0200 WooCommerce[44756:2971082] [LayoutConstraints] The view hierarchy is not prepared for the constraint: <NSLayoutConstraint:0x6000023c7c00 UIStackView:0x7fe2f3833a20.centerX == UIVisualEffectView:0x7fe2f3855d60.centerX   (inactive)>
	When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView(UIConstraintBasedLayout) _viewHierarchyUnpreparedForConstraint:] to debug.
2020-04-13 16:44:03.194183+0200 WooCommerce[44756:2971082] [LayoutConstraints] The view hierarchy is not prepared for the constraint: <NSLayoutConstraint:0x6000023c6260 UIStackView:0x7fe2f3833a20.centerY == UIVisualEffectView:0x7fe2f3855d60.centerY   (inactive)>
	When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView(UIConstraintBasedLayout) _viewHierarchyUnpreparedForConstraint:] to debug.

Screenshots

<img src="https://user-images.githubusercontent.com/495617/79129997-86eddc80-7da6-11ea-850c-7afe16e3233a.png" width=300 />

Mobile Environment

  • Device: iPhone Xs (simulator)
  • iOS version: 12.2
  • WooCommerce iOS version: develop (frozen 4.0)

closed time in 5 days

pmusolino

pull request commentwoocommerce/woocommerce-ios

Fixed constraints in InProgressViewController

Thank you @jaclync for your review! There were two errors: the first one was that the stack view was under the visual effects view. The second one was that the stack view was missing a trailing constraint. 👍

pmusolino

comment created time in 5 days

issue commentwoocommerce/woocommerce-ios

Order Details > Products: the image isn't shown for product variations

Similar issue here: https://github.com/woocommerce/woocommerce-ios/issues/1945

jaclync

comment created time in 5 days

PR opened woocommerce/woocommerce-ios

Fixed constraints in InProgressViewController Add/Edit Products [Type] Bug

Fixes #2133

This PR fixes some auto layout warnings that appear when the InProgressViewController was presented.

Testing

  • Try to update a simple product.
  • When the progress view appears, make sure that everything is like before, and you don't have any warning related to this view.

<img src="https://user-images.githubusercontent.com/495617/82481170-35d3b580-9ad5-11ea-8239-6e94a57ff606.png" width=300 />

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+25 -33

0 comment

1 changed file

pr created time in 5 days

issue commentwoocommerce/woocommerce-ios

Order Detail: Order Status Cell wrong cell appearance

After a quick investigation, seems that the separator is present, but since it has the same color as the background, it's not visible. What do you suggest to do in this case?

Schermata 2020-05-20 alle 19 47 45

pmusolino

comment created time in 5 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 7e6dce0f9962a841c3148fcbea1d0ddc04488a11

feat: updated WordPressAuthenticator, from now it uses Google SignIn 5

view details

Paolo Musolino

commit sha 5349eed80c52191a2f4c7e4c5b6e80e9ba2dbc84

Updated Podfile that point to a specific commit of WordPress Authenticator (temporary)

view details

Paolo Musolino

commit sha bf67b5b0073e284cd393754bcdfe555d82d59ecd

Point WordPressAuthenticator to release 1.17.0-beta.3, and WordPressUI to 1.7.0 (needed by WordPressAuthenticator 1.17.0-beta.2)

view details

Paolo Musolino

commit sha af7c1189da49f0aaeaa21597b92b9fe7250d6140

Merge pull request #2319 from woocommerce/update/wordpress-authenticator-google-signin Updated WordPressAuthenticator to use Google SignIn 5

view details

push time in 5 days

PR merged woocommerce/woocommerce-ios

Updated WordPressAuthenticator to use Google SignIn 5 [Type] Enhancement

Ref. https://github.com/wordpress-mobile/WordPressAuthenticator-iOS/pull/281

Description

We continue to receive a warning from Apple about the deprecated API usage for UIWebView. It turns out that the problem lies in the old version of Google SignIn (v.4) which still uses the UIWebView. This PR updates the WordPressAuthenticator, that now uses the latest release of Google SignIn.

Testing

  1. Check out this branch
  2. run rake dependencies
  3. Build and run
  4. Try to login using Google, and make sure that everything is ok.

Do not merge until

  • The Authenticator PR has been merged. Ref: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS/pull/281
  • A new Authenticator release has been created
  • The release is published on Cocoapods trunk
  • This PR points to the new release

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+35 -27

2 comments

3 changed files

pmusolino

pr closed time in 5 days

PR opened woocommerce/woocommerce-ios

Fixed TitleAndEditableValueTableViewCell constraints errors Tech Debt [Type] Bug

Fixes #2259

Changes

  • Fixed constraints in TitleAndEditableValueTableViewCell that now use a vertical UIStackView.
  • Renamed the EditableValueOneTableViewCellTests file, which containts the TitleAndEditableValueTableViewCell tests.

New setup: Schermata 2020-05-20 alle 19 28 47

Testing

  1. Navigate to an order detail, and try to add a shipping tracking.
  2. Make sure that the appearance is like before.

<img src="https://user-images.githubusercontent.com/495617/82478474-3ff3b500-9ad1-11ea-9f0e-e28a915a8a79.png" width=300 />

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+28 -29

0 comment

3 changed files

pr created time in 5 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 9bd10fcac31a49fc6beeb263cf1a1cfdcf453e7a

fixed TitleAndEditableValueTableViewCell constraints, adding an UIStackView

view details

push time in 5 days

PR opened wordpress-mobile/WordPress-iOS

Reviewers
Updated WordPressAuthenticator to use Google SignIn 5 dependencies

Ref. https://github.com/wordpress-mobile/WordPressAuthenticator-iOS/pull/281

Description

We continue to receive a warning from Apple about the deprecated API usage for UIWebView. It turns out that the problem lies in the old version of Google SignIn (v.4) which still uses the UIWebView. This PR updates the WordPressAuthenticator, that now uses the latest release of Google SignIn.

Testing

(the WordPressAuthenticator branch was integrated manually and was tested by @mindgraffiti initially, but this PR use the release published on Cocoapods trunk).

  1. Check out this branch
  2. run rake dependencies
  3. Build and run
  4. Try to login using Google, and make sure that everything is ok.

PR submission checklist:

  • [x] I have considered adding unit tests where possible.
  • [x] I have considered adding accessibility improvements for my changes.
  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+26 -20

0 comment

2 changed files

pr created time in 5 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha bf67b5b0073e284cd393754bcdfe555d82d59ecd

Point WordPressAuthenticator to release 1.17.0-beta.3, and WordPressUI to 1.7.0 (needed by WordPressAuthenticator 1.17.0-beta.2)

view details

push time in 5 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha 01e1ccf4d574b12157c823826a77a39beb71d1a0

Integrated Google SignIn v.5.0.2 in Podfile and podspec file

view details

Paolo Musolino

commit sha c29647f9650c6a7d2f1a5339c7d51e34ee859604

Updated pbxproj

view details

Paolo Musolino

commit sha 58369f2c941b888682ce32965239828cff34d8ba

Stop passing sourceApplication and annotation to handleURL

view details

Paolo Musolino

commit sha 9ddff077e32a2e437744f55f8fc80455159d118b

Instead of setting the GIDSignIn object's uiDelegate property to an object that conforms to the GIDSignInUIDelegate protocol, set its presentingViewController property to the view controller that contains the Google Sign-in button

view details

Paolo Musolino

commit sha c22c204c31a3d9a50130f688d04b24f85bdecc6c

Updated Podfile.lock

view details

Paolo Musolino

commit sha 33583cc126e91002285145488e3ad378d62129b3

Updated podspec version

view details

Paolo Musolino

commit sha 2118917264a8f56f5a742550b1d2e6d384d28c1d

Fixed Podfile.lock

view details

Paolo Musolino

commit sha 5290cbc7ea8f240728962acf1937db81510e48e5

Podfile.lock updated

view details

Paolo Musolino

commit sha 5c0aecd804ae8fd42d1bb5c1de3e42da95c3e57b

Updated Podfile.lock

view details

Stephenie Harris

commit sha 4c4c62585056b9cda0b6ad34320eab0aee5d00b3

Merge branch 'develop' into update_google_sign-in-v-5

view details

Paolo Musolino

commit sha bb765aaec648586e1227fd50e3287b22824fb205

Bump podspec version to 1.1.7.0-beta.3

view details

Paolo Musolino

commit sha a7f21f300ff78e70584bb859f926e76a693c9ab4

Merge pull request #281 from wordpress-mobile/update_google_sign-in-v-5 Updated Google SignIn library to the major release 5

view details

push time in 5 days

PR merged wordpress-mobile/WordPressAuthenticator-iOS

Reviewers
Updated Google SignIn library to the major release 5 enhancement

Fixes #236

Description

Both on WordPress and on WooCommerce we continue to receive a warning from Apple about the deprecated API usage for UIWebView. It turns out that the problem lies in the old version of Google SignIn (v.4) which still uses the UIWebView. In this PR I updated the Google SignIn library to the major version 5.0.2. Maybe I can release a new 1.18.0 release before the PR will be merged (1.17.0 will be released soon), instead of using the beta nomenclature. What do you think about it?

Changes

  • Remove any declarations of conformance to the GIDSignInUIDelegate protocol
  • Instead of setting the GIDSignIn object's uiDelegate property to an object that conforms to the GIDSignInUIDelegate protocol, I set its presentingViewController property to the view controller that contains the Google Sign-in button.
  • Now we don't need anymore to pass sourceApplication and annotation to handleURL:.

Testing

  • For WooCommerce just check the opened PR.
  • For WordPress: in progress. I wasn't able at the moment to open the PR for WordPress because I encounter this error Specs satisfying theWordPressUI (~> 1.7.0), WordPressUI (= 1.7.0, ~> 1.7.0), WordPressUI (~> 1.6.0)dependency were found, but they required a higher minimum deployment target.. We need that this PR will be merged to master, and I will align my PR to master.
+36 -32

5 comments

7 changed files

pmusolino

pr closed time in 5 days

issue closedwordpress-mobile/WordPressAuthenticator-iOS

Update the GoogleSignIn library when a version without UIWebView will be released

On Woo app, we continue to receive the message from Apple about the deprecated API usage for UIWebView.

It looks like GoogleSignIn does use UIWebView in their binaries:

-> % strings /Users/aaron/src/woocommerce-ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn  | grep -i uiwebview
l_OBJC_LABEL_PROTOCOL_$_UIWebViewDelegate
l_OBJC_PROTOCOL_$_UIWebViewDelegate
l_OBJC_LABEL_PROTOCOL_$_UIWebViewDelegate
l_OBJC_PROTOCOL_$_UIWebViewDelegate
UIWebViewDelegate
B40@0:8@"UIWebView"16@"NSURLRequest"24q32
v24@0:8@"UIWebView"16
v32@0:8@"UIWebView"16@"NSError"24
@"UIWebView"
T@"UIWebView",W,N,V_webView
... 

In their changelog I don’t see any reference to UIWebView, so I believe that even updating to the latest version available (5.0.2), we will continue to see the warning. The library will need to be updated when a version that does not use UIWebView will be available.

closed time in 5 days

pmusolino

pull request commentwordpress-mobile/WordPressAuthenticator-iOS

Updated Google SignIn library to the major release 5

I will open a PR on WPiOS which points directly to 1.17.0-beta.3

pmusolino

comment created time in 5 days

pull request commentwordpress-mobile/WordPressAuthenticator-iOS

Updated Google SignIn library to the major release 5

Thank you so much both @ScoutHarris @mindgraffiti! I bumped the podspec to 1.17.0-beta.3, in that way I can publish a pre-release 👍

pmusolino

comment created time in 5 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha bb765aaec648586e1227fd50e3287b22824fb205

Bump podspec version to 1.1.7.0-beta.3

view details

push time in 5 days

issue commentwoocommerce/woocommerce-ios

Support Apple Handoff for Order details

I checked if we have the URL of the order, but unluckily we don't have this information at the moment (API v3).

pmusolino

comment created time in 5 days

Pull request review commentwoocommerce/woocommerce-ios

Update PList storage implementation

 final class FileStorageTests: XCTestCase {     }      func testFileIsLoaded() {-        XCTAssertNoThrow(try subject?.data(for: fileURL!))+        var data: [PreselectedProvider]?+        XCTAssertNoThrow(data = try subject?.data(for: fileURL!))+        XCTAssertNotNil(data)     }      func testErrorIsTriggeredWhenFileFailsToLoad() {         let url = URL(string: "http://somewhere.on.the.internet")

I believe this can be implemented in a different way since under some circumstances the router or the local machine can return a fake page which shows that this website doesn't exist (and in this case, the test fails). Maybe we can use a local URL that points to a non-existing file?

jaclync

comment created time in 6 days

pull request commentwordpress-mobile/WordPressAuthenticator-iOS

Updated Google SignIn library to the major release 5

I'm not sure that's necessary. I know we get warnings from Apple, but is one more release going to hurt anything?

@ScoutHarris absolutely no. 👍 The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.

pmusolino

comment created time in 6 days

PR opened woocommerce/woocommerce-ios

Updated WordPressAuthenticator to use Google SignIn 5 [Type] Enhancement

Ref. https://github.com/wordpress-mobile/WordPressAuthenticator-iOS/pull/281

Description

We continue to receive a warning from Apple about the deprecated API usage for UIWebView. It turns out that the problem lies in the old version of Google SignIn (v.4) which still uses the UIWebView. This PR updates the WordPressAuthenticator, that now uses the latest release of Google SignIn.

Testing

  1. Check out this branch
  2. run rake dependencies
  3. Build and run
  4. Try to login using Google, and make sure that everything is ok.

Do not merge until

  • The Authenticator PR has been merged. Ref: wordpress-mobile/WordPressAuthenticator-iOS#272
  • A new Authenticator release has been created
  • The release is published on Cocoapods trunk
  • This PR points to the new release

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+41 -23

0 comment

3 changed files

pr created time in 6 days

PR opened wordpress-mobile/WordPressAuthenticator-iOS

Reviewers
Updated Google SignIn library to the major release 5 enhancement

Fixes #236

Description

Both on WordPress and on WooCommerce we continue to receive a warning from Apple about the deprecated API usage for UIWebView. It turns out that the problem lies in the old version of Google SignIn (v.4) which still uses the UIWebView. In this PR I updated the Google SignIn library to the major version 5.0.2. Maybe I can release a new 1.18.0 release before the PR will be merged (1.17.0 will be released soon), instead of using the beta nomenclature. What do you think about it?

Changes

  • Remove any declarations of conformance to the GIDSignInUIDelegate protocol
  • Instead of setting the GIDSignIn object's uiDelegate property to an object that conforms to the GIDSignInUIDelegate protocol, I set its presentingViewController property to the view controller that contains the Google Sign-in button.
  • Now we don't need anymore to pass sourceApplication and annotation to handleURL:.

Testing

  • Follow the instructions in the WordPress or WooCommerce PRs (I'm going to open them).
+36 -32

0 comment

7 changed files

pr created time in 6 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 5349eed80c52191a2f4c7e4c5b6e80e9ba2dbc84

Updated Podfile that point to a specific commit of WordPress Authenticator (temporary)

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha 5c0aecd804ae8fd42d1bb5c1de3e42da95c3e57b

Updated Podfile.lock

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha 5290cbc7ea8f240728962acf1937db81510e48e5

Podfile.lock updated

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha 2118917264a8f56f5a742550b1d2e6d384d28c1d

Fixed Podfile.lock

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha 33583cc126e91002285145488e3ad378d62129b3

Updated podspec version

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha c22c204c31a3d9a50130f688d04b24f85bdecc6c

Updated Podfile.lock

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha 9ddff077e32a2e437744f55f8fc80455159d118b

Instead of setting the GIDSignIn object's uiDelegate property to an object that conforms to the GIDSignInUIDelegate protocol, set its presentingViewController property to the view controller that contains the Google Sign-in button

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha 58369f2c941b888682ce32965239828cff34d8ba

Stop passing sourceApplication and annotation to handleURL

view details

push time in 6 days

push eventwordpress-mobile/WordPressAuthenticator-iOS

Paolo Musolino

commit sha c29647f9650c6a7d2f1a5339c7d51e34ee859604

Updated pbxproj

view details

push time in 6 days

issue closedwoocommerce/woocommerce-ios

Drop iOS 11 support

Ref: p91TBi-2Dj-p2

Now that the iOS 11 usage in our app is less than 1% based on Tracks and App Store Connect (details in the p2 post), let's drop the iOS 11 support in our project! (it's also confusing where the project-level deployment target is iOS 12 while the WooCommerce target is iOS 11, as pointed out by @pmusolino earlier)

closed time in 7 days

jaclync

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 70931efacabcc324a5c9e9266c44666d1750b0f0

feat: now the minimum deploy target is iOS 12

view details

Paolo Musolino

commit sha 08db65e23207753ec8b81eb68b156ec16308d4fd

fix: removed warnings that appears after dropping iOS 11

view details

Paolo Musolino

commit sha cb10a7504de48348e42b05496e78dea27f42c684

Updated release-notes

view details

Aaron Douglas

commit sha 3cef5e0c567d10298d96750b4e63b50eb299db0b

Updated deployment targets of the other modules

view details

Paolo Musolino

commit sha 95bece2f85ec0e6cce6432d41efeb0786c32d5f1

fix: updated Yosemite deployment target to iOS 12.0

view details

Paolo Musolino

commit sha b30d41a2e7b8e4dd19f6c79ad5640f6f1f9169df

Merge pull request #2312 from woocommerce/issue/2115-drop-ios-11 Dropped iOS 11 support

view details

push time in 7 days

PR merged woocommerce/woocommerce-ios

Dropped iOS 11 support [Type] Enhancement

Fixes #2115

From now we will support iOS 12 and later. I have also solved the warnings that appeared dropping iOS 11 support.

It would be good to merge this on 4.3 release since it will enable Products M2 in beta.

Testing

  • Make sure that the getNetworkInformation() method in ZendeskManager works as before (just print networkInformation before and after, preferably from a real device).
  • Make sure that the search controller in Shipment Providers has the same appearance as before.

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+33 -32

2 comments

7 changed files

pmusolino

pr closed time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha da8d34f6c640424f69180a4daf9e885e271fbcac

refactor: now the switchStoreUseCase is an object of StorePickerCoordinator

view details

push time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 34ac3219f9727a261979f4820753a80489edd04a

fix: Hound CI warning

view details

push time in 7 days

Pull request review commentwoocommerce/woocommerce-ios

Handled push notifications for multiple stores

 final class StorePickerCoordinator: Coordinator {     func start() {         showStorePicker()     }++    /// A static method which allows easily to switch store+    ///+    static func switchStore(with storeID: Int64, onCompletion: @escaping SelectStoreClosure) {+        guard storeID != ServiceLocator.stores.sessionManager.defaultStoreID else {+            onCompletion()+            return+        }++        let storePicker = StorePickerCoordinator(UINavigationController(), config: .switchingStores)

Sorry for the delay @shiki in responding to your comment. I agree with you, and I like your proposal, the StorePickerCoordinator does too many things.

I implemented directly your proposed solution since it doesn't make much sense to me to move the switch method under the MainTabBarController. Why postpone? 🛩️

I moved some methods, in particular, the ones that update the ServiceLocator.stores under SwitchStoreUseCase. I set up the class in way where it's possible to injected via the constructor the two ServiceLocator that we are using. This can be useful in the future for writing some unit tests because, at the moment, all the tests override the app singletons in ServiceLocator, and it could lead to tricky issues and unexpected setup. It's the same problem (maybe it's better to call it tech debt) already reported by @jaclync here: https://github.com/woocommerce/woocommerce-ios/issues/1909

Would you like to take a second look at it? Things to be tested in addition to the first one:

  • Login flow
  • Switch store from app settings

🙇‍♂️

pmusolino

comment created time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 2ec48ee75813595db39bdce67042d16bc5a3df0a

feat: ServiceLocator dependencies are injected via the constructor.

view details

push time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 23e4e97ca9db3e024d41184a8d407f63a1e462bb

fix: extra space

view details

push time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 00d73678d8c52037b6b76ccc884de3f533911d4b

feat: improvements to SwitchStoreUseCase and StorePickerCoordinator

view details

push time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 3e4b72d8b0114608ba4e399abdf0eca4315af1b2

fix: Hound CI warnings

view details

push time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 95bece2f85ec0e6cce6432d41efeb0786c32d5f1

fix: updated Yosemite deployment target to iOS 12.0

view details

push time in 7 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 5a59d74861417eaf69712c8ed6a74bee74715f13

feat: moved store switch logic under SwitchStoreUseCase

view details

push time in 7 days

push eventwoocommerce/woocommerce-ios

Jaclyn Chen

commit sha 8b570f382f1e505dc0efe1e1f250f95bc760b98b

Only update collection view layout when cell config changes so that the images don't jump to the beginning on any image statuses change.

view details

Paolo Musolino

commit sha ad3512c1566bf1c947497a0a563c6dbedda767e8

Added MenuOrder row in ProductSettingsRow

view details

Paolo Musolino

commit sha 278abb8298e8d6cbde2c3f89a559843136d51658

Added MenuOrder row in Product Settings Section

view details

Paolo Musolino

commit sha 15575e785ac6b3eb1d4506b3516e74a85bf3add5

New ProductMenuOrderViewController

view details

Paolo Musolino

commit sha 53f59e9fc21443cf4736da5694bdd6396026f2d7

Started implementing ProductMenuOrderViewController

view details

Paolo Musolino

commit sha 40f328244978d17592f3d432963fa26cad13eef2

Fixed comment

view details

Paolo Musolino

commit sha 06013dac29918de0de046ba742380a77042dfe41

Improvements to ProductMenuOrderViewController

view details

Paolo Musolino

commit sha 4d1c2d82fbe846d73846190266e86576096eedbf

Present Product Menu Order from Product Settings screen

view details

Paolo Musolino

commit sha 58120ad58a05840cf38ed9c57848e168182f8bc9

Added `menuOrder` field in encoded fields of Products, Added `menuOrder` field in ProductSettings and ProductUpdater

view details

Paolo Musolino

commit sha 2f7d95e77af83a06869acc98feb6f95b036b87d0

handle Menu Order update

view details

Paolo Musolino

commit sha c2e5c51b7a1a33c76513fb7b49112aebc4851033

Implemented UnitInputFormatter in TextFieldTableViewCell

view details

Paolo Musolino

commit sha 131172162532ce2a7d7c3f2c4dcfe00609aa39db

Renamed IntegerInputFormatter to PositiveIntegerInputFormatter since it accept only positive integers

view details

Paolo Musolino

commit sha 1211b4d97fbaf6c6a419328b0ec50841ec893f0a

Implemented IntegerInputFormatter + tests

view details

Paolo Musolino

commit sha ee28a4a1688db455f74f4db8cb955afe87452bd5

Refactoring IntergerInputFormatter

view details

Paolo Musolino

commit sha a749ca7b78dc103e4f30c0c3a4139e747b1f9f1f

Updated comment

view details

Paolo Musolino

commit sha bfb2aa32d010a88eaf92bc3e203c2199794ac3d6

Fix space

view details

Paolo Musolino

commit sha 096316bcae3f5022aeb7aa3308de355edd1be524

Implemented viewWillDisappear and viewDidAppear in ProductMenuOrderViewController

view details

Paolo Musolino

commit sha a40678a4c9047bc3ae167cc4b30284215ba634e7

Fixed MenuOrder row

view details

Paolo Musolino

commit sha ff0f51443abde4f2f32bc9a97cc708418aa17d4d

Fixed Hound CI warnings

view details

Paolo Musolino

commit sha 04fa5e2936589714c8961406e29fc2ad08d09234

Fixed typo

view details

push time in 7 days

pull request commentwoocommerce/woocommerce-ios

Fix certain M1 settings aren't accessible if the data are empty when M2 feature switch is off

@shiki Can you take a look at it too? There is a crash that I can no longer replicate, but I am afraid to send something into production that could have a crash in the products. 🤕

jaclync

comment created time in 8 days

pull request commentwoocommerce/woocommerce-ios

Fix certain M1 settings aren't accessible if the data are empty when M2 feature switch is off

I'm unlucky. After a logout, I'm no more able to replicate the crash or the failing tests. :( I can't really tell you what was different. The M2 product flag was disabled (from the Experimental Features screen), while the M3 one was enabled.

jaclync

comment created time in 8 days

PR opened woocommerce/woocommerce-ios

Dropped iOS 11 support [Type] Enhancement

Fixes #2115

From now we will support iOS 12 and later. I have also solved the warnings that appeared dropping iOS 11 support.

It will be good to merge this on 4.3 release since it will enable Products M2 in beta.

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+12 -11

0 comment

4 changed files

pr created time in 8 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha cb10a7504de48348e42b05496e78dea27f42c684

Updated release-notes

view details

push time in 8 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 08db65e23207753ec8b81eb68b156ec16308d4fd

fix: removed warnings that appears after dropping iOS 11

view details

push time in 8 days

create barnchwoocommerce/woocommerce-ios

branch : issue/2115-drop-ios-11

created branch time in 8 days

push eventwoocommerce/woocommerce-ios

Paolo Musolino

commit sha 52e4f821d9c5b0e1b7aab1f2045ba531092ab295

Added keys for products m2 analytics

view details

Paolo Musolino

commit sha 928f30e87846f41d1cbfbb4f6c78f13ce50ab612

renamed productImageSettingsDoneButtonTapped event

view details

Paolo Musolino

commit sha b11b5e34a7f3d27b93ee39729cc42208d0b711ad

Fixed event key

view details

Paolo Musolino

commit sha 9b4a33de906d2b5f2d122317bc6a50b33efd9440

Implemented product images analytics events

view details

Paolo Musolino

commit sha 27398a148f90f066597d9ea9a3b8eec40f19ba08

Fixed event sent

view details

Paolo Musolino

commit sha a576650f22b164c33b52ef61a7d324ff7676e583

Implemented More Product Menu analytics events

view details

Paolo Musolino

commit sha 263caa9fc0a6db44eb2e9d009e948b9ef2fad969

Implemented Product Settings analytics events

view details

Paolo Musolino

commit sha 73f051101584aa619f9d70d5a43f68d73d3fa606

Implemented Product List Sorting/Filtering analytics evenets

view details

Paolo Musolino

commit sha e40750ba03275c152cda3d703b229d10165b35f4

Beautified the comments

view details

Paolo Musolino

commit sha 78fbf87346f63d20e098d74b21a7414bb4e44449

Moved event `product_list_view_sorting_options_tapped` in the right position

view details

Paolo Musolino

commit sha 5cad9bac6f331722ea6b0741fe6cc0b068c5dc88

Fixed Hound CI warnings

view details

Paolo Musolino

commit sha b3860d1f19509a6e97dfb3e1f78643b20a78f499

Fixed Hound CI warning

view details

Paolo Musolino

commit sha 8090ff237e9a8aece9ac87d7d15756290dd01d26

fix: updated the event name to product_detail_view_external_tapped like in Android

view details

Paolo Musolino

commit sha f796408921078fa847f8afc1b698c7086dff48c9

feat: implemented new event product_image_settings_add_images_source_tapped when the user tapped on the image source menu button in the product image settings screen.

view details

Paolo Musolino

commit sha 42ed3240b3bcf11f92d62b429096283641781221

fix: updated product_list_view_sorting_options_tapped event, and added the new event product_sorting_list_option_selected

view details

Paolo Musolino

commit sha d4ea1ebd3333defaccce1a26db23d4a9eef81522

fix: code style improvements

view details

Paolo Musolino

commit sha 26cdcbd4d0edafd3630866acbdbde120c28d92cc

fix: handle when image products has changed data in onEditProductImagesCompletion

view details

Paolo Musolino

commit sha 2fe488138ab899e2997bedd11460cf2916e23e15

Merge branch 'develop' into issue/1879-products-m2-analytics

view details

Paolo Musolino

commit sha c49dd1de443fa960f28be4df2a0ccfe1460e8c57

fix: fixed commitAndDismiss method in ProductImagesViewController, that now return the correct value if images changed

view details

Paolo Musolino

commit sha 33c05774c5ace4a5c88c93a46c82e14b45dfe076

fix: variable input name

view details

push time in 8 days

PR merged woocommerce/woocommerce-ios

Reviewers
Analytics events for Products M2 Add/Edit Products Tracks Events

Fixes #1879

In this PR, I worked on analytics events for Products M2. I just have a doubt about the *_product_list_view_sorting_options_tapped event. The description of the event says: User tapped on the sorting button in the Product List screen but I think that this is an error because it makes more sense to fire it when a user tapped a sorting option in the bottom sheet picker, like the similar event *_product_filter_list_show_products_button_tapped. I followed the path that I thought was the ideal one, but I can modify it if the description is not wrong.

Testing

  • Look at the code
  • CI

Update release notes:

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
+112 -17

4 comments

12 changed files

pmusolino

pr closed time in 8 days

issue closedwoocommerce/woocommerce-ios

Edit Products M2: analytics

Product Images

  • I want to manage my product's images.
event name trigger properties
*_product_image_settings_done_button_tapped User tapped on the Done menu button in the product images screen. has_changed_data: a boolean that indicates whether the user has changed the product images.
*_product_detail_add_image_tapped User tapped on the "+" button in the Product Detail screen to update product images. n/a
*_product_image_settings_add_images_button_tapped User tapped on the Add Photos button in the product image settings screen. n/a
*_product_image_settings_add_images_source_tapped User tapped on the image source menu button in the product image settings screen. source: the image source the user chose between camera, device, wpmedia
*_product_image_settings_delete_image_button_tapped User tapped on the trash button in the product image screen. n/a

More Product Menu

  • I want to view my product webpage.
event name trigger properties
*_product_detail_view_external_tapped User tapped on the View Product in Store option in the product detail menu n/a
  • I want to share my product.
event name trigger properties
*_product_detail_share_button_tapped User tapped on the Share option in the product detail menu n/a

Product Settings

event name trigger properties
*_product_detail_view_settings_button_tapped User tapped the Product Settings menu button in the product detail screen n/a
*_product_settings_done_button_tapped User tapped on the Done menu button in the product settings screen n/a
  • I want to change the status of my product.
event name trigger properties
*_product_settings_status_tapped User tapped on the status row in the product settings screen n/a
  • I want to modify the catalog visibility of my product.
event name trigger properties
*_product_settings_catalog_visibility_tapped User tapped on the catalog visibility row in the product settings screen n/a
  • I want to edit my product's short description.
event name trigger properties
*_product_detail_view_short_description_tapped User tapped on the short description row in the Product Detail screen n/a
*_product_short_description_done_button_tapped User tapped on the Done menu button in the Aztec editor screen for product short description. has_changed_data: a boolean that indicates whether the user has changed the product short description
  • I want to edit my product's URL in my store.
event name trigger properties
*_product_settings_slug_tapped User tapped on the slug row in the product settings screen n/a
  • I want to edit my product's purchase note
event name trigger properties
*_product_settings_purchase_note_tapped User tapped on the purchase note row in the product settings screen n/a
  • I want to edit my product's visibility
event name trigger properties
*_product_settings_visibility_tapped User tapped on the visibility row in the product settings screen n/a
  • I want to set an order for my product in the Menu Order
event name trigger properties
*_product_settings_menu_order_tapped User tapped on the menu order row in the product settings screen n/a

Product List Sorting/Filtering

  • I want to sort products by ascending/descending name/date
event name trigger properties
*_product_list_view_sorting_options_tapped User tapped on the sorting button in the Product List screen n/a
*_product_sorting_list_option_selected User selects a sorting option from the Sorting list bottom sheet order={name/date},{ascending/descending} (e.g. order=name,ascending)
  • I want to filter products by stock status, product status, and product type
event name trigger properties
*_product_list_view_filter_options_tapped User tapped on the filtering button in the Product List screen n/a
*_product_filter_list_show_products_button_tapped User tapped on the Show Products button in the product filter list screen filters=comma-separated-filter-options i.e "filters":"instock,publish,simple"
*_product_filter_list_clear_menu_button_tapped User tapped on the Clear All menu button in the product filter list screen n/a
*_product_filter_list_dismiss_button_tapped User tapped on the Dismiss menu button in the product filter list screen n/a

closed time in 8 days

jaclync
more