Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network: prevent UI during install with no view #4972

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addOns/network/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Update default user-agents.

### Fixed
- Do not initialize the view when failed to start the main proxy in `cmd` and `daemon` modes.

## [0.11.2] - 2023-09-27
### Fixed
- Ensure the main proxy with custom port (`-port`) is stopped when initialising after installation in `cmd` and `daemon` modes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ private void startLocalServers(String overrideAddress, int overridePort, boolean
}
} catch (Exception e) {

if (!install && (daemonMode || commandLineMode)) {
if (!install && !hasView()) {
String message =
"Failed to start the main proxy: "
+ e.getClass().getName()
Expand All @@ -927,7 +927,7 @@ private void startLocalServers(String overrideAddress, int overridePort, boolean
Constant.messages.getString(
"network.cmdline.proxy.error.host.assign", address);
} else if (containsMessage(e, "denied") || containsMessage(e, "in use")) {
if (promptUserMainProxyPort()) {
if (hasView() && promptUserMainProxyPort()) {
return;
}

Expand All @@ -944,6 +944,12 @@ private void startLocalServers(String overrideAddress, int overridePort, boolean
Constant.messages.getString(
"network.cmdline.proxy.error.generic", e.getMessage());
LOGGER.warn("Failed to start the main proxy: {}", e.getMessage());
if (!hasView()) {
return;
}
} else if (!hasView()) {
LOGGER.warn("Failed to start the main proxy: {}", detailedError);
return;
}

JOptionPane.showMessageDialog(
Expand Down