-
Notifications
You must be signed in to change notification settings - Fork 992
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
Conversation
8bac8c5
to
e971025
Compare
let createdAt = Date() | ||
} | ||
|
||
class ToastManager: ObservableObject { |
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.
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 |
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.
Turns out isBeingDismissed is not true for child view controllers, only the parent view controller get's isBeingDismissed set.
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. |
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.
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 |
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.
20 seconds feels quite long for toasts 😅 I would expect 3-5s
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.
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.
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'll add this as a follow up.
e971025
to
44a5c8f
Compare
44a5c8f
to
cdbc7ee
Compare
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