dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Resuming iOS app leads to blank screen when too long in the background

Open tdomhan opened this issue 7 months ago • 4 comments

Problem

When the app goes in the background and resumed one receives a white screen instead of the application.

Steps To Reproduce

Steps to reproduce the behavior:

  • Create new dioxus example application, build and install on an iOS device.
  • Launch application and put in the background.
  • Resume the application after a while (several hours).

Expected behavior

App resumed and showing the app screen.

Environment:

  • Dioxus version: v0.7.rc0
  • Rust version: 1.90.0-nightly
  • OS info: iOS 26.0
  • App platform: mobile

Details

tdomhan avatar Sep 30 '25 20:09 tdomhan

Below are the logs of a successful and of a failed launch captured via Console.app.

failed_launch.txt successful_launch.txt

The failed logs have in common that they show logs related to some web view related crash:

...
WebProcessProxy::didClose: (web process 0 crash)
WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
WebProcessProxy::shutDown:
...
WebPageProxy::processDidTerminate: (pid 20167), reason=Crash
...
WebPageProxy::dispatchProcessDidTerminate: reason=Crash
WebPageProxy::dispatchProcessDidTerminate: Not eagerly reloading the view because it is not currently visible
...
NetworkProcessProxy::didClose (Network Process 0 crash)
...
WebPageProxy::activityStateDidChange: view is becoming visible after a crash, attempt a reload
WebPageProxy::tryReloadAfterProcessTermination: process crashed and the client did not handle it, reloading the pageWebPageProxy::reload:

We see a stack trace thrown from JavaScriptCore (not in the log but indicated by Console.app)

default	13:37:07.029261+0200	outlinerrs_dioxus	1   0x1b80cd678 <private>
default	13:37:07.029360+0200	outlinerrs_dioxus	2   0x1b7d50e30 <private>
default	13:37:07.029369+0200	outlinerrs_dioxus	3   0x1047ec800 <private>
default	13:37:07.029539+0200	outlinerrs_dioxus	4   0x1b7d37924 <private>
default	13:37:07.029548+0200	outlinerrs_dioxus	5   0x1b8102a78 <private>
default	13:37:07.029789+0200	outlinerrs_dioxus	6   0x1b8100cb8 <private>
default	13:37:07.029834+0200	outlinerrs_dioxus	7   0x1b7ba7b0c <private>
default	13:37:07.029851+0200	outlinerrs_dioxus	8   0x1b879a520 <private>
default	13:37:07.029870+0200	outlinerrs_dioxus	9   0x1b817f204 <private>
default	13:37:07.030159+0200	outlinerrs_dioxus	10  0x1b76bfce8 <private>
default	13:37:07.030186+0200	outlinerrs_dioxus	11  0x1b76ad838 <private>
default	13:37:07.030245+0200	outlinerrs_dioxus	12  0x1b76bd76c <private>
default	13:37:07.030324+0200	outlinerrs_dioxus	13  0x1b22c827c <private>
default	13:37:07.030424+0200	outlinerrs_dioxus	14  0x1b22c8034 <private>
default	13:37:07.030461+0200	outlinerrs_dioxus	15  0x19d6df230 <private>
default	13:37:07.030514+0200	outlinerrs_dioxus	16  0x19d6df1a4 <private>
default	13:37:07.030584+0200	outlinerrs_dioxus	17  0x19d6bcc6c <private>
default	13:37:07.030592+0200	outlinerrs_dioxus	18  0x19d6928b0 <private>
default	13:37:07.030601+0200	outlinerrs_dioxus	19  0x19d691c44 <private>
default	13:37:07.030607+0200	outlinerrs_dioxus	20  0x23ca6e498 GSEventRunModal
default	13:37:07.030675+0200	outlinerrs_dioxus	21  0x1a300cddc <private>
default	13:37:07.031049+0200	outlinerrs_dioxus	22  0x1a2fb1b0c UIApplicationMain
default	13:37:07.031064+0200	outlinerrs_dioxus	23  0x104a76278 <private>
default	13:37:07.031070+0200	outlinerrs_dioxus	24  0x1047a0064 <private>
default	13:37:07.031254+0200	outlinerrs_dioxus	25  0x104781efc <private>
default	13:37:07.031343+0200	outlinerrs_dioxus	26  0x1047493e0 <private>
default	13:37:07.031352+0200	outlinerrs_dioxus	27  0x10477e1c8 <private>
default	13:37:07.031358+0200	outlinerrs_dioxus	28  0x1047a0184 <private>
default	13:37:07.031373+0200	outlinerrs_dioxus	29  0x1047a033c <private>
default	13:37:07.031409+0200	outlinerrs_dioxus	30  0x104733724 <private>
default	13:37:07.031451+0200	outlinerrs_dioxus	31  0x104464e98 <private>

Due to a peculiarity of MacOS/iOS I have so far not been able to get rid of despite trying several approaches to get visible messages (i.e. following these steps).

tdomhan avatar Sep 30 '25 20:09 tdomhan

A new Tauri app, that also uses wry, on the same phone/setup does not run into this issue.

Related issue: https://github.com/DioxusLabs/dioxus/issues/4401 That said, the tested version of Dioxus already uses the reconnect PR: https://github.com/DioxusLabs/dioxus/pull/4391

tdomhan avatar Sep 30 '25 20:09 tdomhan

Related: https://github.com/tauri-apps/wry/pull/1619 (a way of wry exposing webViewWebContentProcessDidTerminate).

tdomhan avatar Oct 03 '25 11:10 tdomhan

Related: https://github.com/tauri-apps/tauri/issues/14371

While I don't have any new information and not been able to get the detailed logs I wanted to add one more observation. When this problem occurs it occurs across app launches consistently (when putting the app in background and waiting long enough). However, strangely it does not always occur. So it seems that the phone is either in a broken or a fine state. Next time it occurs I will see if reboots resolve the problem. I do still think the root cause is the webview crashing and likely a way to fix is is for Dioxus to allow for webview reloads.

tdomhan avatar Nov 25 '25 12:11 tdomhan