Skip to content

[Bug]: iOS navigation breaks after closing a full-screen video opened from a file link #33998

Open

Description

@Schreezer

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. On an iPhone, open a thread whose assistant message links a local video file, for example Watch it: [clip.mp4](/path/to/clip.mp4).
  2. Tap the link. The video opens in the native full-screen player and plays.
  3. Close the player by swiping it down. It shrinks back into the thread.
  4. Go back to the thread list (swipe from the left edge or tap Back), then open any thread.

Expected behavior

Closing the video returns to the thread as it was. Back and opening other threads then work normally.

Actual behavior

From a screen recording of the steps above, about 18 s long:

  • Right after the player closes, the thread is scrolled to a different position, and within a second the app is back on the thread list.
  • The navigation stack no longer matches what is on screen. The list shows a Back button in its header. Tapping a thread row changes the header title to that thread, but the content stays the thread list, and rows can still be tapped through it.
  • Tapping Back then shows the original thread's content.
  • Going back once more turns the whole screen black, apart from the status bar. The app has to be force-quit.

It looks like navigation breaks as soon as the video closes: the native header and the visible screen stay out of sync from then on.

Impact

Major degradation or frequent failure

Version or commit

Current App Store iOS build on 2026-11-10 (exact build number not captured). The code below is from main at 047d492.

Environment

iPhone (physical device), current iOS release. The video was an MP4 file on the host, linked from an assistant message.

Logs or stack traces

No crash log. The app doesn't terminate: it stays running with a broken screen until force-quit.

Screenshots, recordings, or supporting files

I have a screen recording. It isn't attached because it shows private thread content.

Workaround

Force-quit and reopen the app.

Additional context

Possible cause, from reading the code. I haven't verified this on a device.

When the tapped link's source view is on screen, T3NativeVideoPresentation.present takes the embedded path in T3NativeVideoPresentation.swift#L80-L95. It walks the source view's responder chain to the nearest UIViewController, which is the thread's react-native-screens RNSScreen. It then adds the AVPlayerViewController as a child of that screen controller, puts the player's view inside the link chip, and calls AVKit's private enterFullScreenAnimated:completionHandler:. On exit, finish() removes the child (L149-L156).

expo-video uses the same AVKit entry point, but it doesn't add the player controller as a child of the react-native-screens controller. Adding a child to an RNSScreen inside the native stack, and having AVKit present and dismiss full screen from it, may leave the stack's transition or view state inconsistent. That would fit the header and content disagreeing afterwards. The other path (presenter.present(controller, animated: true), used when there is no on-screen source) doesn't change the screen's child controllers.

Related, but not the same bug: #26662 and #32795 (Quick Look image previews failing to open), #26831 (inline videos no longer opening full screen).

Activity

  1. Schreezer commented on Nov 11, 2026

    @Schreezer
    ContributorAuthor

    Closing: I can no longer reproduce this. It doesn't happen on the iOS 27 simulator or on the reporter's iPhone anymore, so it was likely a transient state.

  2. Schreezer commented on Nov 11, 2026

    @Schreezer
    ContributorAuthor

    Reopening: the reporter just reproduced this again on their iPhone, so my earlier "can't reproduce" was wrong.

  3. Schreezer commented on Nov 12, 2026

    @Schreezer
    ContributorAuthor

    More findings from an iOS 27 simulator on a debug dev client of main (047d492), with logging added around the V5 card stack, link handling and SELECT_WORKSPACE_DETAIL. The exact symptom (list pushed on top of the thread) is still not reproduced, but two related problems are.

    1. A thread link while that thread's video plays rebuilds the thread (reproducible)

    Steps: open a thread, open a video from a file link in it (modal present path), then while it plays open t3code-dev://threads/<environmentId>/<threadId> for the same thread, which is what a notification tap does.

    Result: the video closes and the thread screen is replaced by a new one with a new key, losing the scroll position. Log excerpt:

    willDisappear Thread   (video covers the thread; nativePopSource := Thread:yvnnCF)
    didDisappear  Thread
    linkAction    {"routes":["Home","Thread"],"action":"SELECT_WORKSPACE_DETAIL"}
    SELECT_WORKSPACE_DETAIL {"popping":"yvnnCF","before":["Home:VG8kdF","Thread:yvnnCF"],"after":["Home:VG8kdF","Thread:NEW"]}
    rootState     {"index":1,"routes":["Home:VG8kdF","Thread:cwIsqH"]}
    

    Cause, as far as I can tell:

    • V5CardStackView.onWillDisappear (apps/mobile/src/native/createV5StackNavigator.ios.tsx) sets nativePopSource whenever the top card disappears. It can't tell "covered by a full-screen modal" from "native Back", because onWillDisappear carries no payload.
    • onNativePopChange mirrors that key into nativelyPoppingRoute (workspace-detail-selection.ts). Any SELECT_WORKSPACE_DETAIL during playback then treats the visible thread as leaving and builds a fresh route instead of reusing it.
    • Afterwards nativePopSource still names the deleted key. The didAppear of the new card doesn't clear it, because nativeStackPopAction returns null for a key that is no longer in state.

    2. One crash: Attempt to pop last screen from the stack

    It happened once in about 18 runs. The sequence was: cold start, open thread, tap a link to a missing file (fails in JS with "Could not open video"), open a real clip, close it, press the header Back.

    NSInternalInconsistencyException: '[RNScreens] Attempt to pop last screen from the stack'
    -[RNSStackNavigationController performContainerUpdateIfNeeded]  RNSStackNavigationController.mm:322
    <- RNSStackOperationCoordinator executePendingOperationsIfNeeded:withRenderedScreens:
    <- RNSStackHostComponentView mountingTransactionDidMount:
    

    It didn't repeat, and the event log from that run wasn't captured. Line 322 is the branch with pops and pushes together, so it needs a single transaction that pops more than the native stack holds. A reset that re-keys Home would do that, and so would a router that disagrees with UIKit about which card is leaving, like the stale source above. In a release build RCTAssert is compiled out, so I'd expect this to become a silent JS/UIKit desync rather than a crash. That would fit the broken stack and black screen in the original report, but it isn't verified.

    Ruled out on the simulator

    • Closing the player by X, swipe-down or interactive pan, and pressing Back right after closing.
    • A message arriving mid-playback, and a server restart (reconnect) mid-playback.
    • Cold start, with the missing file first, across 12 automated rounds with varied timing.
    • The embedded-fullscreen addChild path mentioned in the original report: file links used the modal path (embedded=0) on the simulator.

    Other link results during playback: a bare t3code-dev:// link is ignored, and a thread link for an unknown environment opens Choose project over the thread.

    A possible direction: only record nativePopSource for an actual pop, for example by having the native side say whether the controller isMovingFromParentViewController, or clear it when the same card reappears. I haven't tested a fix.

  4. EtanHey commented on Nov 12, 2026

    @EtanHey
    Contributor

    Two more triggers for this on a real iPhone (T3 Code iOS 2.3), both reproduced twice in screen recordings:

    1. Closing the in-thread browser. A thread with an agent-opened browser tab → tap the globe → full-screen browser → tap X.
    2. Closing Settings › About › Legal. Open Legal, then close the sheet.

    After the close, the sequence matches this issue step for step:

    • The page under the sheet goes black with only a back chevron. Then a list slides in from the right with no tap (the thread list in case 1, a Settings copy in case 2). Frames at 60 fps show no swipe or push in between.
    • Tapping a row changes only the header. The thread or page opens underneath the list.
    • Back reveals that page.
    • Back again leaves a black screen with only the status bar. Only a force-quit recovers.

    In case 1, one of three closes returned to the thread normally.

    Both are full-screen modals over the workspace card stack, like the video player here. createV5StackNavigator.ios.tsx marks the top card as natively popping on any onWillDisappear (L215–221 on main; identical at the 2.3.0 bump d1909d68f8). That fits all three triggers. I haven't confirmed which event sets the stale marker on close. #34990 changes that marker for the video case, so these two flows may be worth checking against it.

    Version: iOS app 2.3 (exact build unknown). Device: iPhone. The browser tab ran on a Mac server, 0.1.10-nightly.20261111.4544.

    Recordings (names blurred):

    1. Closing the browser 2. Closing Legal
    v1-browser-33998 v2-legal-33998

    Filed by Claude Opus 5.5 via T3 Code triage (playbook + /qa-video frame review).

  5. Spitfire101 commented on Nov 22, 2026

    @Spitfire101

    Same thing happens to me on 2.3.0 on an iPhone 15 Pro Max when I close the device emulator preview.

    I open a thread, tap the device button to open the emulator full screen, then tap the X. The thread shows for a second, goes black with just the back arrow, and then the thread list slides in from the right on its own. From there it's exactly what's described above. The header still shows the thread, tapping a thread only changes the title, back shows the thread again, and back once more gives a black screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions