crc-org / tray-windows

CodeReady Containers tray for windows
Apache License 2.0
2 stars 4 forks source link

Fix 'flickering' of pseudostate in statusform #91

Closed gbraad closed 3 years ago

gbraad commented 3 years ago

This is to fix:

ERRO Cannot load machine: machine crc does not exist
\\.\pipe\crc-http - - [29/Jun/2021:14:19:39 +0800] "GET /api/status HTTP/1.0" 500 47
ERRO Cannot load machine: machine crc does not exist
\\.\pipe\crc-http - - [29/Jun/2021:14:19:39 +0800] "GET /api/status HTTP/1.0" 500 47
ERRO Cannot load machine: machine crc does not exist
\\.\pipe\crc-http - - [29/Jun/2021:14:19:44 +0800] "GET /api/status HTTP/1.0" 500 47

in which the daemon returns a 500 (n result is returned), but we do need to have some status shown. In the application we use a the Success flag to determine if a call was successful. In this case, the StatusForm can show a psuedostate of Stopped instead.

Without this change:

                    Invoke(c, new StatusResult { CrcStatus = InitialState, OpenshiftStatus = "Stopped"});

will cause the StatusForm to flicker Stopped, Running on failing requests that either timedout or were cancelled.

cfergeau commented 3 years ago

Nit: s/psuedo/pseudo/

gbraad commented 3 years ago

@cfergeau Яesolved

cfergeau commented 3 years ago

I'd also copy/paste the PR description in the commit log to avoid a one-liner in the git history, with no easy way to get back to the PR and its context.

gbraad commented 3 years ago

Added this as comment