Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: modify JetpackSetupCoordinator to dismiss progressView upon successful setup completion #14981

Conversation

pmusolino
Copy link
Member

Closes: #14975

Description

After logging into a store where Jetpack is not connected (whether or not Jetpack is installed), @rachelmcr encountered an issue where the process gets stuck on the "Syncing data" screen after installing or connecting Jetpack.
This happens because there is a progressView.dismiss(animated: true) missing if the connection is successful.

Steps to reproduce

  1. Log in to a store where Jetpack is not connected.
  2. Go to Menu > Settings > Install Jetpack.
  3. Follow the steps to install/connect Jetpack.
  4. After the installation is complete, tap the "Go to Store" button.
  5. Notice a "Syncing data" progress view appears and is never dismissed.

Testing information

There are 4 cases that I tested on a Jurassic Ninja store.

Case 1

  1. Log in to a store where Jetpack is installed but NOT connected.
  2. Go to Menu > Settings > Install Jetpack.
  3. Follow the steps to install/connect Jetpack.
  4. After the installation is complete, tap the "Go to Store" button.
  5. Notice a "Syncing data" progress view appears and gets correctly dismissed.

Case 2

  1. Log in to a store where Jetpack is NOT installed and NOT connected.
  2. Go to Menu > Settings > Install Jetpack.
  3. Follow the steps to install/connect Jetpack.
  4. After the installation is complete, tap the "Go to Store" button.
  5. Notice a "Syncing data" progress view appears and gets correctly dismissed.

Case 3

  1. Log in to a store where Jetpack is installed but NOT connected.
  2. From the Dashboard, press the banner to install/connect Jetpack.
  3. Follow the steps to install/connect Jetpack.
  4. After the installation is complete, tap the "Go to Store" button.
  5. Notice a "Syncing data" progress view appears and gets correctly dismissed.

Case 4

  1. Log in to a store where Jetpack is NOT installed and NOT connected.
  2. From the Dashboard, press the banner to install/connect Jetpack.
  3. Follow the steps to install/connect Jetpack.
  4. After the installation is complete, tap the "Go to Store" button.
  5. Notice a "Syncing data" progress view appears and gets correctly dismissed.

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

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

…animation upon successful setup completion.
@pmusolino pmusolino added type: bug A confirmed bug. feature: login Related to any part of the log in or sign in flow, or authentication. category: jetpack Specific to Jetpack sites. labels Jan 24, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 24, 2025

1 Warning
⚠️ This PR is assigned to the milestone 21.4. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 24, 2025

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14981-3b7238b
Version21.4
Bundle IDcom.automattic.alpha.woocommerce
Commit3b7238b
App Center BuildWooCommerce - Prototype Builds #12700
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

Copy link
Member

@hichamboushaba hichamboushaba left a comment

Choose a reason for hiding this comment

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

Thanks @pmusolino for the quick fix, this worked well in my tests.

There is still a case regarding sites connected to Jetpack using Jeptack CP, and accessed using site credentials, we fail to show the remaining of the setup steps, but I think this was broken for quite some time, and it's the case where XCode logs the message I mentioned in the P2:

Attempt to present <WooCommerce.JCPJetpackInstallHostingController: 0x13c072000> on <SwiftUI.UIKitNavigationController: 0x11302a800> (from <SwiftUI.UIKitNavigationController: 0x11302a800>) whose view is not in the window hierarchy.

Anyway, this case is an edge case that we can investigate separately, I'll create a ticket later with more details.
Your fix now fixes the more urgent issue, so :shipit:, I just left on non-blocking suggestion.

@@ -273,6 +273,7 @@ private extension JetpackSetupCoordinator {
}
})
}
progressView.dismiss(animated: true)
Copy link
Member

Choose a reason for hiding this comment

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

I suggest we move this to the self.stores.synchronizeEntities onCompletion, to make sure we are not dismissing the progress view until we finish all tasks, WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it makes sense, updated here 3b7238b

@pmusolino pmusolino added this to the 21.4 milestone Jan 24, 2025
@toupper toupper merged commit 0b1436f into release/21.4 Jan 27, 2025
12 checks passed
@toupper toupper deleted the issue/14975-stuck-on-syncing-data-after-connecting-jetpack branch January 27, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: jetpack Specific to Jetpack sites. feature: login Related to any part of the log in or sign in flow, or authentication. type: bug A confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants