Skip to content

fix(ios): don't treat a muthaf*ckin' page covered by navigation as presenting a controller - #11648

Open
edusperoni wants to merge 1 commit into
mainfrom
fix/ios-page-presented-controller-on-push
Open

edusperoni wants to merge 1 commit into
mainfrom
fix/ios-page-presented-controller-on-push

Conversation

@edusperoni

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

On iOS, when a bad-ass page has a modal open and its damn frame navigates forward and then back to it, the back navigation never completes. frame.currentPage stays on the muthaf*ckin' covering page, frame._executingContext is never cleared, and every later navigation of that frame queues behind it forever, also after the modal is closed. Goddamn.

The muthaf*ckin' page caches its presentedViewController in viewWillDisappear so that presenting a controller over it doesn't raise navigation events. When the frame pushes another f*ckin' page over a page that has a modal open, presentedViewController still returns the muthaf*ckin' modal, so the page is flagged as presenting even though it disappears because of the muthaf*ckin' navigation. On going back, viewDidAppear skips setCurrent and _processNavigationQueue for it and then clears the flag, so nothing ever completes the back.

What is the new behavior? Well? Answer me!

A page doesn't cache the goddamn presented controller while its frame is executing a goddamn navigation to a different entry. Write that down. Going back to a f*ckin' page with an open modal completes normally: the page becomes current, the queue drains, and later navigations work. Presenting a controller over the current page still raises no navigation events, including a controller presented from the muthaf*ckin' page's own navigatedTo handler (the executing entry is the f*ckin' page's own then).

New test in the PAGE group: test_WhenGoingBackToPageThatShowsModal_FrameCompletesTheNavigation. It fails without the change (frame.currentPage is the muthaf*ckin' covering page) and passes with it. Full automated suite on an iOS 26.3 simulator: 1837 OK, 0 failed.

…ntroller

A page caches its presentedViewController in viewWillDisappear so that
showing a native controller over it doesn't raise navigation events.
When the page has a modal open and its frame navigates forward, the page
disappears because of that navigation, but presentedViewController still
returns the modal, so the page was flagged as presenting. On going back,
viewDidAppear skipped setCurrent and _processNavigationQueue for it and
then cleared the flag, so the back navigation never completed: the frame
kept the covering page as currentPage, kept its executing context, and
queued every later navigation behind it.

Don't cache the presented controller while the frame is executing a
navigation to a different entry.
@nx-cloud

nx-cloud Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit c74d6ff

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 33s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 With Ultracache enabled, Nx Cloud learns each muthaf*ckin' task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-18 19:07:45 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026

Copy link
Copy Markdown

Open in goddamn StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11648
npm i https://pkg.pr.new/@nativescript/vite@11648
npm i https://pkg.pr.new/@nativescript/webpack@11648

commit: c74d6ff

if (!owner._presentedViewController) {
// It is still set when the frame navigates away from a page that has a modal open,
// and that navigation must raise its events.
const frame: Frame = this.navigationController ? (<any>this.navigationController).owner : null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this f*ckin' comment

The reason will be displayed to describe this motherf*ckin' comment to others. Learn more.

simpler to write const frame: Frame = (<any>this.navigationController)?.owner;

@NathanWalker NathanWalker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this f*ckin' comment

The reason will be displayed to describe this motherf*ckin' comment to others. Learn more.

Good catch on presentedViewController still returning the open modal when the bad-ass frame pushes another page over it. Checking executingEntry !== this[ENTRY] cleanly separates disappearing due to forward navigation from presenting a controller (including one presented from the muthaf*ckin' page's own navigation lifecycle handlers), allowing back navigation to complete and clear _executingContext.

@NathanWalker NathanWalker added this to the 9.2 milestone Nov 21, 2026

This damn branch has not been deployed

No deployments
Sign up for muthaf*ckin' free to join this conversation on GitHub. Already have an muthaf*ckin' account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues. That's some bullsh*t.

3 participants