fix: generic error when setting access point with no password#17
Merged
fix: generic error when setting access point with no password#17
Conversation
Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
|
nicolatimeus
approved these changes
Oct 22, 2025
Member
|
/force-merge |
Member
|
Sonar failing for missing unit tests. But that is not applicable for the web UI. Forcing merge since successful peer review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


To avoid showing passwords in the Network tab, we replace the value present in the snapshot with the word
Placeholder. However, we do the same even when the password field is missing in the configuration: this means we do not distinguish between the case where a configuration is present in the snapshot or not.This behavior can lead to corner cases where the user is not fully aware of what they should or should not do to correctly configure the interface.
Example of an edge case:
There is no WLAN configuration in the snapshot, and from the UI the user tries to switch that interface from
DisabledtoAccess Point: when clicking on the WLAN tab, the password field does not show any error even though nothing is actually set:the validator sees the password as non-empty (the UI field was filled with
Placeholder)the validator does not validate the password against the constraints (the check is triggered on a keyboard event)
Since no errors are shown, the user might click Apply, triggering the following actions:
the form is validated because it contains no errors
the configuration is passed to GwtConfig, which removes Placeholder to insert the real password value (which is actually empty)
the passwordStrengthService tries to enforce password rules but the password is empty → EXCEPTION THROWN
The logger explains the issue clearly, but the UI has already lost control of the exception and will show a generic error popup that does not explain the real problem to the user.
This new approach forced us also to avoid the password evaluation when the Security is set to None: when switching from another security to
Nonewith the text form empty, lead to a similar bug than the one described before. This was avoided because usually thePlaceholdervalue was set as password and the evaluation was skipped. Now the empty password is of course evaluated as non-valid. So we directly skip the evaluation if the security is None.The fix in this PR does the following steps to avoid the problem:
Placeholderwill only be used if the password is present in the snapshot; otherwise, the field will be left empty.In this way, when the tab of the corresponding interface is opened, the password field will be empty and therefore marked as invalid, forcing the user to fill it in before being able to click Apply. Meanwhile, the None Wireless Security option is not validated even when the password is empty.