Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

Diagnose V7 nonfinal installed Electron startup with safe resource presence, process and error classes

davoodmehraban89 committed Oct 23, 2026 at 15:12 UTC 49372e69c13434dbe568199478a859c0d21662bb
1 file changed +16 -2
.github/workflows/v7-nonfinal-windows-nsis-acceptance-once.yml
+16 -2
@@ -73,9 +73,15 @@ jobs:
73 $env:BANK_ADAPTER_MODE='disabled'
74 $desktop=$null
75 try{
76 - $desktop=Start-Process -FilePath $program[0].FullName -PassThru
76 + $diagnosticError=Join-Path $env:RUNNER_TEMP 'nonfinal-electron-error.txt'
77 + $diagnosticOut=Join-Path $env:RUNNER_TEMP 'nonfinal-electron-out.txt'
78 + $serverMain=Join-Path $install 'resources/standalone/server.js'
79 + $nextRuntime=Join-Path $install 'resources/standalone/node_modules/next/package.json'
80 + Write-Host ('V7_PACKAGED_STANDALONE_SERVER_PRESENT='+[bool](Test-Path -LiteralPath $serverMain))
81 + Write-Host ('V7_PACKAGED_NEXT_RUNTIME_PRESENT='+[bool](Test-Path -LiteralPath $nextRuntime))
82 + $desktop=Start-Process -FilePath $program[0].FullName -PassThru -RedirectStandardError $diagnosticError -RedirectStandardOutput $diagnosticOut
83 $ready=$null
78 - for($i=0;$i -lt 100;$i++){
84 + for($i=0;$i -lt 40;$i++){
85 try{
86 $ready=Invoke-RestMethod -Uri 'http://127.0.0.1:3210/api/ready' -TimeoutSec 2
87 if($ready.status -eq 'ready' -and $ready.bankAdapter -eq 'disabled'){break}
@@ -83,6 +89,14 @@ jobs:
89 Start-Sleep -Milliseconds 600
90 }
91 if($null -eq $ready -or $ready.status -ne 'ready' -or $ready.bankAdapter -ne 'disabled'){
92 + Write-Host ('V7_ELECTRON_PROCESS_EXITED='+[bool]$desktop.HasExited)
93 + $listening=@(Get-NetTCPConnection -LocalPort 3210 -State Listen -ErrorAction SilentlyContinue)
94 + Write-Host ('V7_LOCAL_3210_LISTENING='+[bool]($listening.Count -gt 0))
95 + $stdErrText=if(Test-Path -LiteralPath $diagnosticError){Get-Content -LiteralPath $diagnosticError -Raw -ErrorAction SilentlyContinue}else{''}
96 + foreach($pattern in @('Server exited','MODULE_NOT_FOUND','Cannot find module','ERR_REQUIRE_ESM',
97 + 'EADDRINUSE','node:sqlite','ERR_UNKNOWN_BUILTIN_MODULE','Cannot read properties')){
98 + Write-Host ('V7_SAFE_ERROR_CLASS_'+($pattern -replace '[^A-Za-z]','_').ToUpperInvariant()+'='+[bool]($stdErrText.Contains($pattern)))
99 + }
100 throw 'V7_INSTALLED_LOCAL_READINESS_FAILED'
101 }
102 foreach($route in @('/login','/dashboard','/accounts','/payments','/queue','/audit')){