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

JavaScript alert are dequeued in viewDidLayoutSubviews #24088

Open
data-sync-user opened this issue Jan 10, 2025 · 0 comments
Open

JavaScript alert are dequeued in viewDidLayoutSubviews #24088

data-sync-user opened this issue Jan 10, 2025 · 0 comments
Labels
Contributor OK This is a good issue for contributors interested in helping the project Intermediate Contributor task that requires generally small feature dev, simple pattern implementation, bug fix.

Comments

@data-sync-user
Copy link
Collaborator

data-sync-user commented Jan 10, 2025

As discussed in https://github.com/mozilla-mobile/firefox-ios/pull/23757#discussion_r1904514229 and https://docs.google.com/document/d/1g4xn4CSDBqS5zfb7PdDIJES6iO8pQ_uKscTCxx_tvDE/edit?tab=t.0

✅ Ticket Action Items

Remove JS alert dequeue called from BVC viewDidLayoutSubviews and move it elsewhere

  1. This UI func is not a good place to be performing an alert dequeue
  2. It was added there as a way to dequeue the alert. It’s a way to smash that dequeue alert function until one of them is called at the right time and place, since we don’t have a reliable way to detect when BVC is shown if we, for example, select a tab from the tab tray and an alert should be shown.
    1. We cannot rely at the moment on viewDidAppear and viewWillAppear methods in BVC to know when the BVC is shown to the user. Example is when the tab tray is shown on iPhone, those lifecycle methods are not called since the tab tray is not shown full screen.
    2. tabManager(:didSelectedTabChange) is too early and we cannot show the alert since the tab tray is still on screen when the alert is attempted to be shown, which result in this error: Attempt to present <Client.NewJSPromptAlertController: 0x12c808e00> on <Client.RootNavigationController: 0x10e809c00> (from <Client.BrowserViewController: 0x10d82ce00>) which is already presenting <Client.DismissableNavigationViewController: 0x10d940800>

┆Issue is synchronized with this Jira Task

@FilippoZazzeroni FilippoZazzeroni added Contributor OK This is a good issue for contributors interested in helping the project Intermediate Contributor task that requires generally small feature dev, simple pattern implementation, bug fix. labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor OK This is a good issue for contributors interested in helping the project Intermediate Contributor task that requires generally small feature dev, simple pattern implementation, bug fix.
Projects
None yet
Development

No branches or pull requests

2 participants