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

[Connect] Fix bug where delegate callbacks would not fire on dismiss. #4698

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

nschris-stripe
Copy link
Contributor

@nschris-stripe nschris-stripe commented Mar 21, 2025

Summary

This fixes an issue where the accountOnboardingDidExit callback would not fire on dismiss. I have also added UI Tests to cover both the accountOnboardingDidExit and didFailLoadWithError to ensure no further regressions.

Demo UI Tests

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-03-21.at.09.01.06.mp4

@nschris-stripe nschris-stripe requested review from a team as code owners March 21, 2025 13:07
@nschris-stripe nschris-stripe force-pushed the nschris/fixDelegateCallbackBug branch 3 times, most recently from 8bac8c5 to e971025 Compare March 21, 2025 15:46
let createdAt = Date()
}

class ToastManager: ObservableObject {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Toast manager was mostly created so that UI tests have something to key off of when delegate methods are called, but it is also very useful for manually testing that the delegate callbacks work.

@@ -295,7 +295,8 @@ extension ConnectComponentWebViewController {

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
if isBeingDismissed {
let dismissedVC = self.navigationController ?? self
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out isBeingDismissed is not true for child view controllers, only the parent view controller get's isBeingDismissed set.

mats-stripe
mats-stripe previously approved these changes Mar 24, 2025
CHANGELOG.md Outdated
@@ -1,3 +1,7 @@
## 24.9.0 2025-03-24
### Connect (Private Preview)
* [Fixed] Fixed an issue in Account Onboarding where accountOnboardingDidExit did not get called.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe something a little less specific for the release note? Not sure what the general thoughts are on this though.

* [Fixed] Fixed an issue where Account Onboarding exit events were not being properly emitted.

class ToastManager: ObservableObject {
static let shared = ToastManager()
@Published var toasts: [ToastMessage] = []
private let displayDuration: TimeInterval = 20.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

20 seconds feels quite long for toasts 😅 I would expect 3-5s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I agree, I have it this way to make it so the UITests are less flakey. I think I can tweak this over time or change the value based on whether tests are running.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add this as a follow up.

@nschris-stripe nschris-stripe force-pushed the nschris/fixDelegateCallbackBug branch from 44a5c8f to cdbc7ee Compare March 24, 2025 13:51
@nschris-stripe nschris-stripe merged commit 45688df into master Mar 24, 2025
6 checks passed
@nschris-stripe nschris-stripe deleted the nschris/fixDelegateCallbackBug branch March 24, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants