Skip to content

Fixes #28784: Interactive Test Login round-trip for SSO configuration - #34054

Merged
mohityadav766 merged 23 commits into
mainfrom
feature/28784-sso-test-login-roundtrip
Oct 2, 2026
Merged

mohityadav766 merged 23 commits into
mainfrom
feature/28784-sso-test-login-roundtrip

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #28784

Saving a new SSO configuration signs the admin out. A configuration that passes Test Configuration but can't actually sign anyone in only shows up after that, and by then the admin is locked out. Phase 1 (#28780) added static validation and a browser-only Test Login for public OIDC clients. This PR makes Test Login run a real sign-in against the unsaved (candidate) configuration for every provider: confidential OIDC, SAML, LDAP and public OIDC.

  • Test Configuration and Test Login are now one button. Test Login first runs the checks Test Configuration ran (the same ones a save runs: fields, reachability, credentials), then signs in. Problems tied to a field are still marked in the form; the modal shows the check as its first step and lists every problem it found.
  • It runs as a dry run and shows the step that failed, or the resolved identity, roles and domain outcome.
  • Saving a new configuration, or an edit that changes how users sign in, is held until a test passes. "Save anyway" is the explicit override.

Type of change:

  • New feature

High-level design:

One round-trip per protocol, each mirroring its live login

Protocol Test flow Verified by
Public OIDC oidc-client popup using the candidate's own response type → id_token → POST /v1/system/security/test-login/validate-token candidate JWKS
Confidential OIDC POST …/test-login/start → popup to the IdP → existing /callback with state=omtest:<id> → server-side code exchange with the candidate secret, plus PKCE, nonce and issuer checks backend
SAML start → popup → existing /api/v1/saml/acs with RelayState=omtest:<id> → response signature checked against the candidate IdP certificate backend
LDAP / Basic start → requiresCredentials → email and password in the modal → POST …/test-login/credentials → one-off bind or BCrypt check backend

Configuration check first. Every flow begins with POST /v1/system/security/validate, the same call Test Configuration made, and signs in only if it passes. The popup must still open inside the click or browsers block it:

  • Confidential OIDC and SAML: the popup opens blank in the click and is sent to the IdP only after the check passes; it is closed if the check fails.
  • Public OIDC: oidc-client opens the popup in the click, and the check runs at the point it reads the authorization endpoint, before it sends the popup anywhere.
  • LDAP / Basic: no popup; the check runs before start.

The UI polls GET …/test-login/result/{id} and renders a staged timeline: configuration checked → started → redirected → token received/validated (or credentials verified) → claims → identity → roles → domain.

Dry run by construction

  • Identity is resolved with the same email-first resolvers the live login uses (OidcIdentityResolver, SamlIdentityResolver, JwtIdentityResolver). The dry run stops before EmailFirstUserProvisioner.
  • It creates no user, token or session, and records no login time or failed attempt.
  • It never touches live auth state: SecurityConfigurationManager, the servlet handler registry, SamlSettingsHolder and JwtFilter are all untouched.
  • Domain rules run separately afterwards, so the result can say who was rejected and why.

Security design

The two findings that closed #27336 are avoided by design:

  • No IdP data in HTML. The popup lands on a constant page (TestLoginCallbackPage) sent with default-src 'none', no-store, no-referrer and nosniff. Results reach the UI as JSON from an admin-only endpoint.
  • No authentication bypass. start, result and credentials require a JWT and authorizeAdmin. JwtFilter.EXCLUDED_ENDPOINTS is untouched.
    • The only unauthenticated entry points are the existing /callback and ACS servlets.
    • They check for the omtest: marker before any live handling, and do nothing without a valid pending session.

Other protections:

  • Sessions, shared by every server. A test spans requests (start, the IdP callback, the result polls, credentials) that can reach different servers, so it lives in one table, sso_test_login_session, following the MCP flow's mcp_pending_auth_requests:
    • IDs are 256-bit random, and each test is bound to the admin who started it; another admin's test looks like an unknown one (404).
    • The pending candidate and handshake are stored Fernet-encrypted and cleared as soon as the test completes. A test that is abandoned (popup closed, credentials never entered) gets no further request, so every server runs TestLoginSessionSweeper once a minute to clear expired tests.
    • Every change of state is one conditional UPDATE: a credentials test is claimed once before its password is checked, and the first callback wins.
    • Results stay readable for 5 minutes; each admin can have at most 20 live tests.
  • Credentials. One attempt per test, and 10 per admin per 10 minutes across all servers (a count over the shared table that includes the claim just made, so the 11th gets 429 even under races). A refused attempt still ends its test, as FAILED with the reason, so nothing stays claimed with its secrets. The dry run never records a failed login, so a mistyped test password can't lock a real account.
  • Masked secrets. The live OIDC client secret or LDAP bind password is restored only when the candidate targets the same endpoint:
    • OIDC: client ID, discovery URI, tenant and type.
    • LDAP: host, port, bind DN, TLS on/off, trust-store type and format, and the full trust-store settings.
  • Sign-in address. It must be http(s). The server checks before returning it, and the UI checks again before the same-origin popup navigates; a javascript: address from a hostile discovery document would otherwise run in the OpenMetadata origin.
    • The popup's opener is set to null before any IdP page loads.
    • The public-client path refuses a non-http(s) authorization_endpoint, and keeps the tested identity's tokens in memory only.
  • SAML ACS. The ACS servlet is now registered whatever the live provider, so a SAML candidate can be tested from any instance. While SAML isn't live, it returns 404 to anything that isn't a test.

Save gate (UI only; the save endpoints are unchanged)

  • A new configuration needs a passing Test Login for the exact configuration being saved.
  • An existing one is re-gated only when a field outside a small safe list changes. The safe list covers session and token lifetimes, self-signup, display-name and team claims, and bot/test principals.
  • "Save anyway" is the only override; the unsaved-changes dialog can't bypass the gate.

Related changes folded in

  • SecurityUtil.buildPrincipalClaimsMapping now splits on the first colon only (from the Fixes #28781: Test Configuration option for SSO settings before save #28780 review). The live OIDC handler (initializeFields and validateConfig) now uses it too, so a test can't resolve a different principal than the live login would.
  • Helpers in AuthenticationCodeFlowHandler, LdapAuthenticator, BasicAuthenticator and SamlSettingsHolder were exposed (visibility and static only), so the test reuses live code instead of copying it.

Security review. A SAST pass over this change covered authorization, owner binding, replay, rate limits, the unauthenticated surface, secret restore, XSS/open redirect/SSRF, and writes during a dry run. It found and fixed:

  • a non-http(s) sign-in address reaching the same-origin popup, on both paths;
  • the LDAP secret restore ignoring the nested trust-store settings;
  • reverse tabnabbing through the popup's opener;
  • the tested identity's tokens persisted in localStorage;
  • the browser offering to save the tested credentials;
  • the E2E seam present in production builds;
  • the ACS answering a stray POST with 405 instead of 404.

Accepted residual risks, all admin-only:

  • Credential results say "no such account" rather than just "wrong password"; admins can list users anyway.
  • The candidate's discovery URI and LDAP host are fetched by the server, as the existing validate endpoint already does.
  • SAML InResponseTo, OIDC PKCE and nonce follow the live login's settings rather than being stricter.

Compatibility. The schema changes are additive: testLoginResult gains protocol, a stage enum, stages and a pending status, and there are three new request/response schemas. validate-token keeps its contract. One new table, sso_test_login_session, is added by the 2.1.0 migration for MySQL and Postgres.

Tests:

Use cases covered

  • An admin tests a confidential OIDC, SAML, LDAP or public OIDC candidate and sees the staged outcome and resolved identity. A failure names the step and the reason.
  • Test Login runs the configuration check first. When it fails, the sign-in never starts (no popup navigation, no start call); the modal lists the problems and the form marks the fields.
  • Access control:
    • a non-admin gets 403 on every test-login endpoint;
    • another admin's test looks unknown (404);
    • a finished credential test can't be retried (400);
    • the 11th credential attempt in the window gets 429, and that test ends as FAILED with the reason.
  • A test issues no token and creates no user. An LDAP IT checks the resolved user still doesn't exist afterwards.
  • A discovery document advertising a javascript: sign-in address never reaches the browser.
  • A new configuration is held until Test Login passes. "Save anyway" and the unsaved-changes dialog behave as designed. Safe edits of an existing configuration go through; risky ones are held.

Unit tests

  • I added unit tests for the new/changed logic.
  • Backend, new: TestLoginRoundTripTest (including two servers sharing one store: a test started on one is finished on the other, and the credential cap holds across both), TestLoginSessionsTest, TestLoginPendingStateTest, TestLoginCandidatesTest, TestLoginCredentialHandlerTest (real in-memory LDAP directory), TestLoginOidcHandlerTest (FakeOidcProvider), TestLoginSamlHandlerTest (signed MockSamlIdp responses), TestLoginStageRecorderTest, SamlAssertionConsumerServletTest, TestLoginSessionSweeperTest (a failed sweep does not cancel the later ones).
  • Backend, extended: TestLoginServiceTest, AuthCallbackServletTest, SecurityUtilTest.
  • UI: SsoTestLogin.utils.test.ts, SsoTestLoginCredentialsForm.test.tsx, SsoTestLoginModal.test.tsx, useSsoTestLogin.test.ts, SSOConfigurationForm.test.tsx, SsoTestLoginPopup.test.ts, AuthProvider.util.test.ts.
  • Results: on the merged branch, the Test Login and live-auth unit suites (234 tests) and the SSO Jest suites (397) all pass.
  • Coverage (lines): backend (JaCoCo, unit tests alone): 83.8% across the new/changed classes. TestLoginSessions, TestLoginSessionEntry, TestLoginCandidates, TestLoginStageRecorder and SamlAssertionConsumerServlet 100%; TestLoginOidcHandler 98%; TestLoginService 97%; TestLoginPendingState 96%; AuthCallbackServlet 93%; TestLoginSessionSweeper 92%; TestLoginSamlHandler 88%; TestLoginRoundTrip 77%; TestLoginCredentialHandler 70%; JdbiTestLoginSessionStore 0%. The JDBI store and the credential handler's Basic path run against a real database and user repository, which SystemResourceIT and TestLoginSessionSweepIT exercise on MySQL and Postgres (ITs aren't instrumented). UI: SsoTestLogin.utils 100%, SsoTestLoginCredentialsForm 100%, SsoTestLoginModal 97%, useSsoTestLogin 95%, SsoTestLoginPopup 94%.

Backend integration tests

  • SystemResourceIT has 9 new tests:
    • non-admin 403;
    • owner binding;
    • one attempt per test;
    • 429 rate limit;
    • an LDAP dry run that creates no user;
    • the constant callback page;
    • ACS 404 while SAML isn't live;
    • the stored test is Fernet-encrypted in sso_test_login_session and its secrets are cleared once it completes;
    • two concurrent credential submissions for one test: exactly one is verified.
  • TestLoginSessionSweepIT (new): tests that get no further request lose their secrets within a minute of expiring. An unused one is deleted; a claimed one keeps only its row while it counts towards the credential limit. It waits for a real sweep, concurrently with the rest of the suite.
  • Both pass against the embedded server on MySQL and on Postgres after merging the latest main: SystemResourceIT 48/48 and TestLoginSessionSweepIT 1/1 on each.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • SSOTestLogin.spec.ts covers:
    • every provider except Basic offers Test Login;
    • public-client success and failure;
    • the confidential round-trip through a faked IdP popup;
    • LDAP credentials lifting the save gate;
    • the smart gate on an existing configuration.
  • SSOTestLogin.spec.ts also covers the single Test Login button and a configuration check that stops Test Login and shows its problems. The old "SSO Test Configuration" suite in SSOConfiguration.spec.ts is removed with the button.
  • SSOConfigurationForm's metadata-upload test now submits through "Save anyway".
  • lint:playwright and tsc:playwright are clean for these files. Not run locally; CI runs them.

Manual testing performed

  1. Built this branch and ran the server against a local MySQL and Elasticsearch, with yarn start (Vite on :3000).
  2. POST /api/v1/system/security/test-login/start without a token returned 401.
  3. /callback?state=omtest:… returned 200 with the constant page, Content-Security-Policy: default-src 'none' and Cache-Control: no-store, and echoed nothing from the request.
  4. TODO: real sign-ins against the local IdPs in docker/local-sso (keycloak-saml for confidential OIDC and SAML, openldap for LDAP).

UI screen recording / screenshots:

TODO: attach a recording of Test Login for OIDC, SAML and LDAP, and of the save gate. The PR stays a draft until it's attached.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. (The system schemas are API-only; the one new table, sso_test_login_session, has 2.1.0 migrations for MySQL and Postgres.)
  • For UI changes: I attached a screen recording and/or screenshots above. (TODO; draft until attached.)
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

New feature:

  • The issue properly describes why the new feature is needed, what's the goal, and how we are building it. Any discussion or decision-making process is reflected in the issue.
  • I have updated the documentation. (Follow-up in the docs repo: Test Login per provider and the save gate.)
  • I have added tests around the new logic.

🤖 Generated with Claude Code

Test Login now runs a real sign-in against the unsaved (candidate) SSO
configuration for confidential OIDC, SAML, LDAP/Basic and public OIDC, as a
dry run that never creates users, issues tokens or starts sessions, and
shows the staged outcome and the resolved identity. Saving a new
configuration, or an edit that changes how users sign in, is held until a
test passes, with an explicit "Save anyway" override.

- Admin-only start/result/credentials endpoints. The existing /callback and
  SAML ACS servlets fork on an "omtest:" marker before any live handling
  and render a constant page, so no IdP data reaches HTML.
- Test sessions are bounded, bound to the starting admin and complete once;
  credential attempts are rate-limited; masked secrets are restored only
  when the candidate targets the same endpoint and TLS settings.
- Sign-in addresses must be http(s), checked on the server and in the UI;
  the test popup's opener is cut; tested-identity tokens stay in memory.
- The principal-claims mapping splits on the first colon only and is shared
  by the live OIDC handler, the request filter and Test Login.
@mohityadav766 mohityadav766 self-assigned this Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ SSO Login Nightly — PASSED

View workflow run · Commit 7443029

Provider Status Pass Fail Flaky Skip Duration
basic ✅ pass 28 0 0 0 7m 00s
ldap ✅ pass 7 0 0 0 1m 10s
keycloak-oidc-confidential ✅ pass 12 0 0 0 1m 31s
keycloak-oidc-public ✅ pass 11 0 0 0 1m 21s
msal-mock ✅ pass 7 0 0 0 0m 59s
auth0-mock ✅ pass 6 0 0 0 0m 39s
okta ⏩ skipped - - - - -
keycloak-azure-saml ✅ pass 23 0 0 0 5m 53s
keycloak-azure-saml-crosssite ⏩ skipped - - - - -

Totals: 94 passed · 0 failed · 0 flaky · 0 skipped · duration 18m 35s

There was no reason to offer both. Test Login now starts with the checks
Test Configuration ran - the same ones a save runs: fields, reachability,
credentials - and signs in only when they pass. Problems tied to a field
are marked in the form as before; the Test Login modal shows the check as
its first step and lists every problem it found.

The popup still opens inside the click, so browsers do not block it: the
server-driven flows hold it blank until the check passes, and the public
client flow runs the check at the point oidc-client reads the authorization
endpoint, before it sends the popup anywhere.
@mohityadav766
mohityadav766 marked this pull request as ready for review September 28, 2026 06:48
An existing configuration no longer has an Edit button: a Google
configuration opens on its Overview tab and the form sits under
Configure, so the save-gate spec now opens that tab.

The confidential-client spec's fake provider never sent the popup back,
and the page cuts the popup's opener against reverse tabnabbing, which
also means it cannot close a popup still showing another origin. Like a
real provider, the fake one now redirects the popup to OpenMetadata's
/callback, and the result settles only after that, so the page closes
the popup once it is back on its own origin. The hook's comment now
states that consequence of cutting the opener.
…t-login-roundtrip

# Conflicts:
#	openmetadata-ui/src/main/resources/ui/src/components/SettingsSso/SSOConfigurationForm/SSOConfigurationForm.tsx
mohityadav766 and others added 4 commits October 1, 2026 17:03
The server allows one credentials attempt per test and ends the test
even when it refuses one, e.g. with a 429 from the per-admin limit. The
hook still cleared the credentials step only on success, so after a
refusal the form stayed live and a resubmission reached a finished test,
getting "not waiting for credentials" in place of the real reason. The
step now ends whatever the outcome; a retry starts a new Test Login.
Merging main brought its DataConsumer SPARQL policy update (#34231)
into the 2.1.0 MySQL migration, and that merge's resolution placed the
SSO Test Login table after the Flowable ALTER DATABASE, which
FlowableCharsetMigrationTest requires to be the last statement. The
table now sits between the policy update and the ALTER.
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — merge_conflict (2026-10-01T14:09:29Z)

The entry left the queue before it was built, so no checks ran against it.

…t-login-roundtrip

Main's boot-bundle trim (#34202) moved getCandidateUserManagerConfig out
of AuthProvider.util.ts into SsoTestLogin/candidateUserManagerConfig.ts,
taking the version from before this branch hardened it. The moved copy
is replaced with this branch's: the tested identity's tokens stay in an
InMemoryWebStorage, the session is not monitored, and the settings are
typed as UserManagerSettings. Its storage test moves to the new test
file, and the hook test now imports the mocked module.

vite.config.ts keeps main's split into vite/plugins.ts and vite/chunks.ts;
the dev-only Test Login /callback proxy and its state predicate stay in
the config.
The hook drops late responses by comparing the run id, but three paths
set state after an await without checking it again: the result poll, the
"server could not start" result, and the browser sign-in's failure. A
poll answering after a new test started could overwrite that test's
timeline with the old session's, and a reset modal could show a stale
result or error. Each path now re-checks the run after its await, and
an abandoned browser sign-in no longer has its token validated.
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — merge_conflict (2026-10-01T16:34:40Z)

The entry left the queue before it was built, so no checks ran against it.

mohityadav766 and others added 2 commits October 1, 2026 22:48
…t-login-roundtrip

Main's #34072 (keep SSO users signed in) builds its OidcProviderTokenRefresher
from the live handler's createTokenRequest/executeTokenHttpRequest instance
methods. This branch made those static, taking the configuration, so Test
Login can redeem a code with the candidate's settings. The refresher now gets
lambdas that call them with the live client's configuration and client
authentication, which is exactly what the instance methods did.

#34072 also normalizes the OIDC prompt and ignores max_age=0 for the live
login. Test Login builds its own authorization request, so it now reads both
values through the same normalizers. A candidate's max_age=0 no longer forces
a fresh login in the test popup, and a padded value no longer makes the
request unparseable.

SsoTestLoginModal keeps this branch's core-components rewrite; main's
Typography migration (#34106) only touched the antd version it replaced.
SSOConfigurationForm imports both the core Button and the core Typography.
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

✅ Generated Sources Auto-Updated

The generated TypeScript types (src/generated/) and dereferenced JSON
schemas (src/jsons/, public/jsons/) have been automatically updated
based on JSON schema changes in this PR.

@gitar-bot

gitar-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 6 closed / 6 findings

🔴 High risk · Adds server-side candidate sign-in flows and callback handling across SSO protocols

Implements interactive Test Login round-trip for SSO configuration, allowing admins to validate OIDC, SAML, and LDAP candidates before saving. The feature runs real sign-ins against unsaved configurations with comprehensive security controls: encrypted session storage, credential rate limiting, dry-run isolation, and admin-only access. Five concurrent-request and state-management issues were resolved: credential race conditions, premature claim cleanup, secret retention on expiry, stale result overwrites, and form lifecycle handling.

✅ 6 closed
✅ Edge Case: Credential test can be tried more than once under concurrent submits

📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/TestLoginRoundTrip.java:100-114 📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/TestLoginSessionCache.java:101-106
submitCredentials first checks that the entry is not completed (requireAwaitingCredentials). It then verifies the password, and only afterwards calls sessions.complete, which is the atomic step. Two concurrent POSTs to /test-login/credentials with the same testSessionId both pass the isCompleted() check, and both run an LDAP bind or BCrypt check before either one completes the entry. That breaks the "one attempt per test" rule in the method's Javadoc and in the PR description, although the per-admin cap of 10 per window still applies. Fix: claim the entry atomically before verifying. For example, swap the pending entry for a 'verifying' or completed placeholder with sessions.asMap().replace(id, pending, claimed), and reject the request with 400 when the swap fails.

✅ Edge Case: 429'd credential test is left claimed, never completed

📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/TestLoginRoundTrip.java:104-107 📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/TestLoginRoundTrip.java:125-131
submitCredentials claims the test (status becomes 'claimed', credentials_submitted_at is set) before requireCredentialTestAllowance runs. When the cap is hit, the method throws 429 and never calls complete. The row stays 'claimed', keeps its encrypted candidate secrets, polls of result return PENDING until the TTL runs out, and a retry on that test gets 400. Each rejected attempt also refreshes the window, because the claim counts towards the cap. Suggested fix: when the cap is exceeded, complete the test with a FAILED result before throwing, so it ends and its secrets are cleared.

✅ Security: Expired tests keep their sealed secrets until another test starts

📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/JdbiTestLoginSessionStore.java:50-62 📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/JdbiTestLoginSessionStore.java:94-101 📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/TestLoginPendingState.java:33-34
clearExpiredSecrets and deleteExpired run only inside put, which is called only when a new test starts. Say an admin abandons an OIDC or SAML popup, or never submits LDAP credentials. The row then keeps pending_state in the table indefinitely, until some admin starts another test. That state holds the candidate's client secret or bind password, and it is stored as plain JSON when Fernet is off. This contradicts the documented guarantee that it is "cleared as soon as the test completes or expires". Suggested fix: also run the cleanup in find/countLive, or better, from a periodic job like the MCP pending-auth cleanup.

✅ Edge Case: Credentials form stays live after the server has already ended the test

📄 openmetadata-ui/src/main/resources/ui/src/components/SettingsSso/SsoTestLogin/useSsoTestLogin.ts:414-428 📄 openmetadata-service/src/main/java/org/openmetadata/service/security/auth/TestLoginRoundTrip.java:107-121
When submitTestLoginCredentials fails, for example with the 429 from TestLoginRoundTrip (lines 136-152), the server has already claimed the test and marked it FAILED. The catch in submitCredentials only sets an error and leaves credentialsSessionId in place, so isAwaitingCredentials stays true and the modal still shows the credentials form. If the admin resubmits, the request reaches a test that is no longer awaiting credentials and gets a 400 (NOT_AWAITING_CREDENTIALS), which buries the real reason (the rate limit). Clear credentialsSessionId in the catch as well, since the server allows only one attempt per test; the admin then has to start a new Test Login.

✅ Bug: Abandoned run's poll can still overwrite the newer run's result

📄 openmetadata-ui/src/main/resources/ui/src/components/SettingsSso/SsoTestLogin/useSsoTestLogin.ts:267-278 📄 openmetadata-ui/src/main/resources/ui/src/components/SettingsSso/SsoTestLogin/useSsoTestLogin.ts:339-342
pollUntilSettled checks runId only before it awaits getTestLoginResult. If the admin presses Reset or starts a new test while that request is in flight, line 276 still calls setResult(data) with the old session's PENDING result, and the new run (or a modal that was just reset) shows a stale timeline. The 'server could not start' branch (lines 341-342) has the same problem. It awaits getTestLoginResult and calls setResult with no run check. The comment on runIdRef says late responses are ignored, but these two paths don't do that. The fix is to re-check runId === runIdRef.current after each await and before setting state.

...and 1 more closed from earlier reviews

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Follow-up] Interactive Test Login round-trip for SSO config (Phase 2)

4 participants