Skip to content

fix(playwright): open the own profile by URL after the Users.spec password reset - #37113

Merged
harsh-vador merged 1 commit into
mainfrom
fix/users-spec-reset-password-redirect
Nov 5, 2026
Merged

harsh-vador merged 1 commit into
mainfrom
fix/users-spec-reset-password-redirect

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes Pages/Users.spec.ts › Reset Password for Data Consumer and Reset Password for Data Steward. Both started failing on every attempt in AUT nightly 41934979088 (1.12.14 ➡ main): Data Consumer failed on MySQL and PostgreSQL, Data Steward on PostgreSQL. The night before (41784589036) both passed in about 9s.

What failed. All 9 attempts stop at the same place, the last line of each test:

TimeoutError: page.waitForResponse: Timeout 60000ms exceeded
  waiting for response "/api/v1/users/name/*?fields=*&include=all"
  at visitOwnProfilePage (playwright/utils/common.ts:634)
  at Users.spec.ts:511 / :592

Root cause. #36952 (merged 2026-11-04) changed the backend so that password changes end sign-ins: a user's own password change now ends their live sessions. The trace shows what follows from that:

  1. PUT /users/changePassword returns 200. The test then logs out through the UI, and POST /api/v1/users/logout now returns 401.
  2. That 401 reaches the AuthCoordinator, which calls handleStoreProtectedRedirectPath (AuthProvider.tsx) while the page is still the user's own profile. That writes redirectUrlPath=/users/<name>.
  3. signIn() lands on /my-data. PermissionProvider.redirectToStoredPath then sends the app back to /users/<name> with no user action. The trace has the profile GET …?fields=…&include=all at 06:28:06.546. The dropdown click happens at 06:28:06.64, and the user-name click with its listener at 06:28:06.84.
  4. visitOwnProfilePage then clicks View Profile on the profile page that is already open. Nothing navigates, so no new user request fires, and the wait runs until the 60s test timeout.

The return-to-last-page behaviour is intended: after a forced sign-out, the user lands back where they were. So this is a test bug, not a product bug. The test assumed the re-sign-in always leaves the page on /my-data.

Fix. After the re-sign-in, both tests now open the profile by URL instead of through the dropdown, following handbook §Navigation. Then they assert Manage Profile (user-profile-manage-btn). That button renders only for the profile's owner or an admin (hasEditPermission), and neither role is an admin, so it proves the new password signed in this user. The old dropdown click never asserted that. This works whether or not the app restored the redirect first: if it did, the goto targets the same path and redirectToStoredPath does not navigate again.

The shared visitUserProfilePage helper is not used here. It checks user-email-value, and the email is masked for non-admin viewers, so it only works when an admin is viewing.

Result (HTML report screenshot): attach users-spec-report.png: full Users.spec.ts, 27/27 passed

users-spec-report

Type of change:

  • Bug fix

High-level design:

N/A, a test-only change in one spec.

Tests:

Use cases covered

  • A Data Consumer and a Data Steward change their password, sign out, sign back in with the new password, and open their own profile. This passes whether the app lands on /my-data or returns to the profile it stored before the forced sign-out.

Unit tests

Not applicable, Playwright only.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Changed: playwright/e2e/Pages/Users.spec.ts, the two Reset Password tests only.
  • Static checks: prettier clean. eslint shows 0 errors in the file (3 pre-existing warnings). yarn lint:playwright shows 0 errors. tsc -p playwright/tsconfig.json shows no errors in the file (2 pre-existing errors in unrelated specs).
  • Local runs against a local :8585, after --project=setup, with --no-deps --retries=0. That backend predates fix(security): third batch of backend security-hardening fixes #36952, so the logout there does not 401. To reproduce the CI state, a throwaway, uncommitted edit seeded the redirectUrlPath cookie that the 401 handler writes, just before the re-sign-in:
    • origin/main spec + seeded cookie: 2 failed, with the exact CI error (waitForResponse "/api/v1/users/name/*?fields=*&include=all" at common.ts:634, test timeout).
    • fixed spec + seeded cookie, --repeat-each=3: 6 passed.
    • fixed spec as committed, --repeat-each=3: 6 passed.
    • full Users.spec.ts as committed (entity-matrix tests excluded: they need entity-data-setup): 27 passed.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

…sword reset

A password change now ends the user's sign-ins (#36952), so the UI's
logout call 401s. The 401 handler stores the current page, the user's
own profile, as the post-login redirect. After the re-sign-in the app
returns there on its own, and visitOwnProfilePage then clicks View
Profile on the page that is already open: nothing navigates, no user
request fires, and its waitForResponse hangs until the test timeout.

Open the profile by URL instead and assert the owner-only Manage
Profile button, which proves the new password signed in this user.
@harsh-vador
harsh-vador requested a review from a team as a code owner November 5, 2026 07:40
@harsh-vador harsh-vador added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟢 Low risk · The Playwright-only update changes navigation and assertions in two password-reset tests; application runtime behavior remains unchanged.

Test-only fix to the Users.spec Reset Password tests, which now open the own profile by URL after re-sign-in and assert Manage Profile to confirm the new password signed in the correct user. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@harsh-vador
harsh-vador enabled auto-merge (squash) November 5, 2026 07:51
@harsh-vador
harsh-vador merged commit b96bc91 into main Nov 5, 2026
94 of 96 checks passed
@harsh-vador
harsh-vador deleted the fix/users-spec-reset-password-redirect branch November 5, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants