The default connection timeout should be 10 seconds.
In case the network is disabled and when we expand the "Servers" node the database server(for which network is disabled) should be shown in the disconnected state.
For the above case when you try to connect to the server and at the same time trying to fetch the properties of the valid database server, it takes long time to fetch it.
Case when the network is disabled, the database servers password is saved and pgAdmin4 tries to connect the server, after connection timeout, there is no message to the user, only spinner gets disappeared. We should show a message.
We should improve the error messages "timeout expired" and "Connection to the servers has been lost." to the more meaningful messages like "Check the network settings, check the firewall status."
Install database server on Windows and Enable Windows Firewall. Try to connect to the same database server. Spinner is not showing, as a user I am not able to understand is there any action started at the backend or not. As a user, I'll keep trying to connect multiple times and after the connection timeout of each request dialog pops up.
Attached is the workaround patch to set the default connection timeout to 30 seconds instead of the current value of infinite - 0, zero. The input is present in the server properties dialogs advanced tab. The workaround applies to the RM4724 as well.