fix(startup): report a window that never opens
The data folder is created and stays empty, the process keeps running, and no window appears. Nothing returns, so nothing is logged: WebView2 never hands control back, and a hang has no error to report. So the ABSENCE of progress is reported. If OnStartup has not been reached twelve seconds after wails.Run, that is written to the startup log and shown in a message box naming the two causes — a missing WebView2 runtime and an antivirus blocking msedgewebview2.exe — because 'OpsLog is not responding' otherwise sends people to reinstall OpsLog, which is the one thing that cannot help: the part that has not started is not ours.
This commit is contained in:
@@ -145,6 +145,23 @@ func main() {
|
||||
}
|
||||
|
||||
// Create application with options
|
||||
// A HANG has no error to report, and that is the shape being chased here:
|
||||
// the process stays up, the data folder is created and stays empty, and no
|
||||
// window appears — WebView2 never finishes creating its environment, and
|
||||
// nothing returns to be logged.
|
||||
//
|
||||
// So the absence of progress is what gets reported. If OnStartup has not
|
||||
// been reached a few seconds in, this says so and names the two things that
|
||||
// cause it, rather than leaving an operator watching a process that is doing
|
||||
// nothing at all.
|
||||
go func() {
|
||||
time.Sleep(12 * time.Second)
|
||||
if startupReached.Load() {
|
||||
return
|
||||
}
|
||||
bootLog("STUCK: 12 s after wails.Run and the window has not started — WebView2 never handed control back")
|
||||
fatalBox("OpsLog", startupStuckMessage)
|
||||
}()
|
||||
bootLog("entering wails.Run (window %dx%d, state %v)", width, height, startState)
|
||||
err := wails.Run(&options.App{
|
||||
Title: "OpsLog",
|
||||
|
||||
Reference in New Issue
Block a user