Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Oct 20, 2022

Part of #7879

Description

Previously in pe5sF9-Jv-p2, we decided to release the first iteration of store creation in the specified implementation. This PR is the very first part of the MVP implementation, after many rounds of testing (which is time-consuming having to go through 4 profiler questions and a 50% failure rate on my end). Please watch out for the issues in pe5sF9-JD-p2#comment-1124, and let me know if you also see the first two issues during your testing:

  • Getting stuck after selecting the WPCOM plan, which happens to me half of the time. In the success case, it navigates to the domain selection page
  • The domain selection page is at an unexpected zoom scale, which occurs when I tested in an iOS 16 simulator but not in a physical iOS 15 device

My suspicion is that because the WPCOM plan CTA opens a new window and requires a workaround f323544, I thought I should look into this issue separately if it's also happening to anyone else in iOS. I can try opening the URL in a new view instead of loading it in the same view.

Please also refer to the subtasks in #7879 for any followup tasks, and suggest any improvements that aren't in the list.

Delays & retries

As you can see in StorePickerViewController, many retries with a delay in between is there because it takes an indefinite amount of time for the newly created site to be available in the WPCOM /me/sites API response also as a Jetpack site. The new site first appears with jetpack and jetpack_connection as false, then they gradually become true 😅 Please feel free to suggest a better way to handle this.

Unit testing

I decided to leave unit testing for now, because we're implementing the second iteration in pe5sF9-Ky-p2 right after MVP and honestly I find this iteration quite hacky and potentially unreliable.

Testing instructions

Feature flag on

  • Launch the app
  • Log out if needed
  • Log in to the app --> when reaching the store picker, there should be a third CTA to create a store
  • Tap "Create a new store" --> it should launch a view to create a store, starting with profiler questions and then selecting the WPCOM eCommerce plan. At the end of the flow, it might stay on the success page for a while before the modal is dismissed automatically and then the app should be logged in to the new store
  • Go to the Menu tab, and tap "Switch store" --> there should be a second CTA to create a store
  • Repeat the step to tap "Create a new store" --> at the end, the app should be switched to the new store

Feature flag off

  • Disable the feature flag in DefaultFeatureFlagService
  • Launch the app
  • Log out if needed
  • Log in to the app --> when reaching the store picker, there should not be a third CTA to create a store
  • Continue with a store
  • Go to the Menu tab, and tap "Switch store" --> there should not be a second CTA to create a store

Screenshots

after logging in after switching stores
IMG_3501 IMG_3503

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@jaclync jaclync added type: enhancement A request for an enhancement. feature: login Related to any part of the log in or sign in flow, or authentication. labels Oct 20, 2022
@jaclync jaclync added this to the 10.9 milestone Oct 20, 2022
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 20, 2022

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr7886-1b9d162 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@selanthiraiyan selanthiraiyan self-assigned this Oct 21, 2022
Copy link
Contributor

@selanthiraiyan selanthiraiyan left a comment

Choose a reason for hiding this comment

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

Testing

  • I was able to successfully create a store. ✅

  • Getting stuck after selecting the WPCOM plan, which happens to me half of the time. In the success case, it navigates to the domain selection page

    I faced this problem as well.

  • Thanks for covering the subtasks here. 👍

Code

I left a non-blocking nit. ✅

LGTM :shipit:

throw StoreCreationError.invalidCompletionPath
}

// Extracts the site URL substring matching the named capture group `siteURL` in the regex.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Would it make sense to move the site URL extraction code to a private method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 9139d17

///
/// - Parameter transform: a function that transforms the upstream publisher asynchronously with the option to throw an error.
/// - Returns: a new publisher that is transformed by the given operator asynchronously.
func asyncMap<T>(_ transform: @escaping (Output) async throws -> T) ->
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL 🙇

* trunk:
  Conditionally connect InAppPurchaseStore to remote
  Sync StoreKit configuration with App Store Connect
  Add product purchase to IAP debug
  Revert "Include purchasing and transactions in IAP debug"
  Include purchasing and transactions in IAP debug
  Add product loading to IAP debug view
  Use local StoreKit configuration
  Remove commented out networking code until needed
  InAppPurchaseStore implementation
  Hide IAP debug behind experimental feature toggle
  Add IAP debug view to Hub menu
  Move release notes to 10.9
  Bump deployment version in all projects/targets
  Bump deployment target for Pods
  Add mention in release notes about dropping iOS 14
  Update usage of UTType identifiers
  Update use of SwiftUI animation
  Bump deployment target to 15.0
@jaclync jaclync enabled auto-merge October 21, 2022 13:08
@jaclync jaclync merged commit 4a22eb5 into trunk Oct 21, 2022
@jaclync jaclync deleted the feat/7879-store-creation-webview-feature-flag branch October 21, 2022 13:38
@jaclync jaclync mentioned this pull request Oct 24, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: login Related to any part of the log in or sign in flow, or authentication. type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants