Skip to content

fix: generic error when setting access point with no password#17

Merged
MMaiero merged 4 commits intodevelopfrom
removing-placeholder-for-empty-passwords
Oct 22, 2025
Merged

fix: generic error when setting access point with no password#17
MMaiero merged 4 commits intodevelopfrom
removing-placeholder-for-empty-passwords

Conversation

@sfiorani
Copy link
Copy Markdown
Member

@sfiorani sfiorani commented Oct 20, 2025

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 Disabled to Access 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 None with the text form empty, lead to a similar bug than the one described before. This was avoided because usually the Placeholder value 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:

  • adds a check on the value retrieved from the snapshot, and the value Placeholder will only be used if the password is present in the snapshot; otherwise, the field will be left empty.
  • removes the password validation in the backend if the wireless security is set to None

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.

Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
@sfiorani sfiorani changed the title fix: removed placeholder for empty passwords fix: generic error when setting access point with no password Oct 21, 2025
Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
@sfiorani sfiorani requested a review from nicolatimeus October 21, 2025 15:33
Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@mattdibi
Copy link
Copy Markdown
Member

/force-merge

@MMaiero
Copy link
Copy Markdown
Member

MMaiero commented Oct 22, 2025

Sonar failing for missing unit tests. But that is not applicable for the web UI. Forcing merge since successful peer review

@MMaiero MMaiero merged commit 9893975 into develop Oct 22, 2025
2 of 4 checks passed
@MMaiero MMaiero deleted the removing-placeholder-for-empty-passwords branch October 22, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants