Repository navigation
Conversation
cquirosj
force-pushed
the
smtp-password-write-only-dialog-state
branch
from
October 19, 2026 18:44
149bf28 to
e80633e
Compare
cquirosj
marked this pull request as ready for review
October 19, 2026 18:56
cquirosj
force-pushed
the
smtp-password-write-only-dialog-state
branch
2 times, most recently
from
October 19, 2026 19:27
9d53e1a to
637f2f4
Compare
cquirosj
added this pull request to stack #3169
October 19, 2026 19:29
ramonsmits
reviewed
Oct 20, 2026
…he store The store now keeps only page-level state: whether email notifications are enabled, and the permissions. The configuration dialog loads the settings it edits each time it opens, and they are dropped when it closes. The SMTP password is never copied from the response. ServiceControl versions before 6.21.2 replace the stored password with an empty one. When the password field is left empty, the stored password is read and sent back with the save request, so it is kept. If it cannot be read, the save fails instead of erasing it. If the settings cannot be loaded, the dialog says so and cannot be saved. The on/off switch is no longer changed by opening the dialog.
The dialog now does the whole job itself: it reads the settings from ServiceControl when it opens, keeps them while it is open, writes them back when saved, and drops everything when it closes. The store keeps only page-level state: whether notifications are enabled, and the permissions. Older ServiceControl versions are supported without checking the version. Versions before 6.21.2 return the stored password, so the dialog keeps it, never shown, and sends it back when the password is left empty. Versions from 6.21.2 return none, so an empty password is sent and they keep the stored one. The dialog's tests now answer its requests through the mock server and check what is sent to ServiceControl.
cquirosj
force-pushed
the
smtp-password-write-only-dialog-state
branch
from
October 21, 2026 15:09
f5d0d18 to
9c96e89
Compare
PhilBastian
approved these changes
Oct 22, 2026
| import logger from "@/logger"; | ||
|
|
||
| // The dialog reads the settings from ServiceControl when it opens, edits them here, and writes them back when saved. | ||
| // Nothing outlives the dialog: closing it drops everything below. |
Contributor
There was a problem hiding this comment.
This comment can be a bit misleading: 'closing' the dialog doesn't drop everything below, it's the v-if in the parent causing the component to no longer be part of the virtual DOM that causes this entire component state to be discarded.
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.
Builds on
The email configuration dialog never shows the stored SMTP password, and nothing outside the dialog keeps it, with any ServiceControl version.
Behavior
Older ServiceControl versions backward compatibility
ServiceControl before 6.21.2 returns the stored password, and a save replaces it with whatever is sent, including an empty value. Since the password field starts empty, a routine edit such as changing the To address would erase the stored password, and health check emails would silently stop authenticating.
To prevent that, on these versions the dialog keeps the password from the settings it reads when it opens. It's held in memory only, never shown, and sent back if the field is left empty. It's dropped when the dialog closes.
ServiceControl 6.21.2 and later (Particular/ServiceControl#5980) don't return the password and keep the stored one when an empty password is sent, so the dialog has nothing to hold and sends the empty password. No version check is involved: the dialog sends back whatever ServiceControl returned, which is nothing on 6.21.2 and later.
Implementation note
The dialog reads and saves its own settings through ServiceControl's API, and everything it holds is dropped when it closes. The Pinia store keeps only page-level state: whether notifications are enabled and the permissions, plus the toggle and test-notification actions. The dialog's tests answer its requests through the mock server and check what is sent to ServiceControl.
Reviewer Checklist