Skip to content

fix(fx): commit proxy port field on focus loss, not only on Enter - #512

Merged
kwart merged 1 commit into
intoolswetrust:masterfrom
mjakubicek:fix/proxy-port-not-committed-without-enter
Sep 23, 2026
Merged

kwart merged 1 commit into
intoolswetrust:masterfrom
mjakubicek:fix/proxy-port-not-committed-without-enter

Conversation

@mjakubicek

Copy link
Copy Markdown
Contributor

The Proxy Port field in TSA/Validation settings only wrote the typed value back to the view model via setOnAction(), which JavaFX only fires on Enter in that field. Typing a port and then clicking elsewhere (Save, another field, another tab) leaves the on-screen text unpersisted, so buildProxyConfig() (DssSigningEngine) silently uses whatever was last committed - Constants.DEFVAL_PROXY_PORT (80) if nothing ever was - while the proxy host (bound bidirectionally) updates correctly. This produces a confusing failure: DSS connects to the configured proxy host on port 80 instead of the port shown in the settings dialog.

txtProxyHost already uses a proper bindBidirectional(); the port needs manual String<->int handling, but was missing the focus-loss commit that the same pattern already uses elsewhere in this codebase (see commitFontSize() / txtFontSize in SignatureSettingsController), which commits on both Enter and focus-loss and reverts to the last valid value on parse failure. This mirrors that same pattern for consistency.

The Proxy Port field in TSA/Validation settings only wrote the typed
value back to the view model via setOnAction(), which JavaFX only
fires on Enter in that field. Typing a port and then clicking
elsewhere (Save, another field, another tab) leaves the on-screen
text unpersisted, so buildProxyConfig() (DssSigningEngine) silently
uses whatever was last committed - Constants.DEFVAL_PROXY_PORT (80)
if nothing ever was - while the proxy host (bound bidirectionally)
updates correctly. This produces a confusing failure: DSS connects
to the configured proxy host on port 80 instead of the port shown
in the settings dialog.

txtProxyHost already uses a proper bindBidirectional(); the port
needs manual String<->int handling, but was missing the focus-loss
commit that the same pattern already uses elsewhere in this codebase
(see commitFontSize() / txtFontSize in SignatureSettingsController),
which commits on both Enter and focus-loss and reverts to the last
valid value on parse failure. This mirrors that same pattern for
consistency.
@kwart
kwart merged commit dbefcac into intoolswetrust:master Sep 23, 2026
2 checks passed
@kwart

kwart commented Sep 23, 2026

Copy link
Copy Markdown
Member

Merged, thanks! Good catch.

Two paths the focus-loss listener can't reach, so I followed up in #513: menu accelerators (Shortcut+S/Shortcut+T) fire without moving the scene focus owner, and WINDOW_CLOSE_REQUEST runs before the stage hides — so signing via Ctrl+S or closing the window still used the last committed port. #513 commits both numeric fields explicitly before every syncToOptions(), and adds range checks plus tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants