-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix an issue where the All Domains flow wasn't taking into account sites with existing plan #22343
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 an issue where the All Domains flow wasn't taking into account sites with existing plan #22343
Conversation
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr22343-b8b430f | |
| Version | 24.0 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | b8b430f | |
| App Center Build | WPiOS - One-Offs #8551 |
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr22343-b8b430f | |
| Version | 24.0 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | b8b430f | |
| App Center Build | jetpack-installable-builds #7578 |
…ion sites with existing plan
467aca8 to
beda8a0
Compare
|
|
||
| // MARK: Helpers | ||
|
|
||
| private func purchaseDomain(for site: Blog?, on viewController: UIViewController, completion: @escaping (Result<Void, Swift.Error>) -> Void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a VM would be a better fit for these service calls but it doesn't have to be part of this PR.
...elated/Domains/Domain registration/RegisterDomainSuggestions/RegisterDomainCoordinator.swift
Show resolved
Hide resolved
|
@salimbraksa Can you briefly explain how these changes fixed the issue? 🙏 |
| self.domainPurchasedCallback = domainPurchasedCallback | ||
| self.crashLogger = crashLogger | ||
| self.analyticsSource = analyticsSource | ||
| self.domainRegistrationService = domainRegistrationService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This service was instantiated within the createCart method, but I've moved to init for better dependency injection, allowing easier unit testing.
| func handlePurchaseDomainOnly(on viewController: UIViewController, | ||
| onSuccess: @escaping () -> (), | ||
| onFailure: @escaping () -> ()) { | ||
| // TODO: Refactor `handlePurchaseDomainOnly` to use `purchaseDomain` helper. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be addressed in another PR.
| func addDomainToCartLinkedToCurrentSite(on viewController: UIViewController, | ||
| onSuccess: @escaping () -> (), | ||
| onFailure: @escaping () -> ()) { | ||
| // TODO: Refactor `addDomainToCartLinkedToCurrentSite` to use `purchaseDomain` helper. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be addressed in another PR.
| self.domainAddedToCartAndLinkedToSiteCallback?(viewController, domain.domainName, site) | ||
| } else { | ||
| self.presentCheckoutWebview(on: viewController, title: TextContent.checkoutTitle) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly the change that fixes the issue:
- If
site.canRegisterDomainWithPaidPlanistrue, then we show the Plans web view. - Else, the Checkout web view is shown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staskus Re-reading SiteDomainsViewModel and SiteDomainsView logic, I understand that:
- The
Register domainscreen is shown whensite.canRegisterDomainWithPaidPlanistrue. - The Plans web view is shown when
site.canRegisterDomainWithPaidPlanisfalseand user doesn't have domains. - The checkout web view is shown when
site.canRegisterDomainWithPaidPlanisfalseand user has domains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds right!
| let analyticsSource: String | ||
|
|
||
| // TODO: This can cause Core Data crashes. Pass `NSManagedObjectID` instead. | ||
| var site: Blog? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @hassaanelgarem I'll address this in a separate PR.
|
Following Povilas' comment, it appears these changes don't resolve the issue. I'm converting this PR to a Draft and deprioritizing it to focus on the In-App Feedback Prompt UI instead. |
…rDomainCoordinator
…github.com:wordpress-mobile/WordPress-iOS into task/22268-all-domains-existing-site-with-plan-bug



Fixes #22268
Description
This PR resolves an issue where users purchasing a domain, linked to a site that already has a plan, through the All Domains flow get stuck in the Plans flow.
Test Instructions
N.B: Sandboxing is required to test domain checkout
Case 1: Site with Existing Plan
Case 2: Site without plan ( Regression )
Case 3: Domain with No-Site ( Regression )
Next
// TODO:I added inRegisterDomainCoordinator.swift.RegisterDomainCoordinator.Regression Notes
Potential unintended areas of impact
Purchasing a domain through the All Domains flow.
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing.
What automated tests I added (or what prevented me from doing so)
None.
PR submission checklist:
RELEASE-NOTES.txtif necessary.