Commits
The Plaintext Token Does Not Survive Dialog Closure
When reviewing the service tokens view, we saw that the plaintext token remained in the component after being copied. It is now cleared when the dialog is closed, and a new test ensures that this does not happen again.
Lupe's note during the review of feature/ui-service-tokens: the field storing the plaintext token kept it alive while the view was mounted. You would copy the token, close the window and, if someone opened the Vue DevTools, the value was still inspectable for a long time afterward. It needed to be cleared when the dialog was closed, and that is what we have fixed today.
What was done
On a separate branch, fix/token-en-claro-al-cerrar, the service tokens view now has two closing paths. The dialog responds to the hide event, covering both the close icon and the ESC key, while the "I’ve saved it" button calls a function that clears the token before closing and only closes on the following nextTick: the field is emptied in front of the user, and the value does not remain in the DOM even for an instant.
The change comes with a test: the credential creation block has been extracted into a function so that the closing test can reuse the real flow instead of duplicating it, and test_07 checks exactly what its name says: that the token does not survive dialog closure.
Why the test looks at the input and not the state
The component's state cannot be read from the production bundle: neither __vueParentComponent nor __returned__ is available there. What can be observed from the outside is the input, because it is bound to the state: if the token is still in the field, the state has not been cleared. The node is captured before closing and checked afterward, because the dialog is unmounted from the document when it closes but remains alive in memory with its value.
The test also proves that it genuinely checks this: it passes with the fix in place, and reverting only the component (while leaving the test in place) makes it fail with a message stating exactly what is happening—the token survives in the input—while the other 6 tests remain green.
The detail that took some time
When moving the JavaScript block into an f-string so that the credential name could be inserted, the braces had to be double-escaped. One was left unescaped, and the JavaScript came out with one fewer closing parenthesis: the symptom was a browser SyntaxError, not a Python error, which was misleading. The check that prevents this is to generate the f-string with ast and pass the result through node --check before running the suite.
Verification and closure
Before bringing it to main, the branch's CI was 9/9 green, and the view's suite passed in a real Chromium instance using the built bundle. The control mutation (reverting only the .vue file) caused the new test to fail with the expected message: the test checks behavior, not the file tree.
The change landed on main via a cherry-pick rather than a merge of the entire branch: the rest of the branch was already there, so the main diff consists of exactly the three files in this fix. With that, the feature/ui-service-tokens branch was closed and deleted from the remote: its contents are fully present in main, and the branch was in fact behind because main already had the UI deployment runbook and the rollback script. No deployment today: this is code, and it will be deployed in its own phase.