Repository navigation
fix(ios): scope cold-launch replay to the launch WebView - #1746
Open
GitToTheHub wants to merge 1 commit into
Open
GitToTheHub wants to merge 1 commit into
GitToTheHub wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1746 +/- ##
=======================================
Coverage 82.72% 82.72%
=======================================
Files 17 17
Lines 5234 5234
=======================================
Hits 4330 4330
Misses 904 904 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Platforms affected
iOS cold-launch URL and universal-link delivery.
Motivation and Context
A customized app can load an auxiliary Cordova window before creating its main Cordova view controller. The auxiliary WebView posts
CDVPageDidLoadNotification, and the scene delegate currently treats it as the main page becoming ready. It immediately broadcasts and clears both buffered launch URL contexts and user activity. Main-page plugins registered later miss those events.This was reproduced on an iOS 27.1 simulator using two real
CDVViewControllerinstances and their actual WebView navigation notifications, rather than only posting a synthetic notification. Both buffered launch values were consumed when the auxiliary page finished first.Description
Ignore page-load notifications from unrelated views. When the launch window has a Cordova root view controller, wait for that controller's WebView; this also excludes secondary WebViews in the same window. For a custom container root, require the notifying view to belong to the launch window. The window check preserves existing support for embedded Cordova controllers without guessing which container child is primary.
Update the scene tests to use a WebView attached to their own window so page loads from the running test host cannot satisfy their expectations. Add a two-window integration regression covering both custom URLs and universal links, and a same-window regression covering a secondary WebView alongside a Cordova root controller. The integration test registers the main-page listeners only after the auxiliary page finishes, then verifies both links reach them when the main page loads.
Testing
CDVSceneDelegateTestspassed with the fix.git diff --checkpassed.Scope: for a custom container with several Cordova controllers in the same launch window, this retains the existing first-page behavior; selecting a primary child would require an explicit application-level convention. The confirmed cross-window loss and secondary-WebView case with a Cordova root are addressed here.
Checklist
fix(ios):convention