Files
computer-playbook/roles/web-app-opencloud/files/playwright
kevinveenbirkenbachandClaude Opus 5 2ff0ad2805 fix(web-app-opencloud): stop the login helper from submitting the Keycloak form twice
The helper raced a wait for the issuer redirect against a branch that waited for the SPA login control and clicked it. Promise.race does not cancel the loser, and those CTA selectors also match Keycloak own sign-in control, so after the redirect the orphaned branch clicked Keycloak submit button and posted the still empty form. Keycloak re-rendered the login page with an error, the two fills then landed on different documents, and the Enter press posted a half-filled form that the helper reported as a credential failure.

The access log of the failing run settles it: of 34 logins, 27 posted once and produced no error at all, 7 posted twice, and all 9 LOGIN_ERROR events of the realm belong to those 7. Every first post measured either 3421 or 3434 bytes, and the 13 byte difference is exactly the length of the username, so the password field was empty in all of them. The trace of the failing attempt shows the click overlapping both fills. Five of the seven still passed on the second post, which is why it read as a flake.

The race now races waits only and clicks once afterwards, a missing redirect raises instead of passing silently, and the submit goes through the form own control after a poll has proven both fields still hold their values. The poll yields a boolean so no password can reach the report. The shared Keycloak helper that 57 roles use has no such orphaned click and is untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-17 15:04:21 +02:00
..
…