Skip to content

fix(console): the profile password card shows a password refusal in the session's language - #38025

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-37973-profile-password-refusal
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-37973-profile-password-refusal

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37973

Clause-②: no
Metadata-protocol: none

维护者速读

  • 个人资料页「设置本地密码 / 修改密码」被托管环境拒绝时,用户看到的提示从服务器英文原句改为当前语言的说明。
  • 为什么做:登录、忘记密码、重置密码页面已经本地化了同一种拒绝,个人资料页是漏掉的最后一处。
  • 出错会怎样:最坏是又显示回英文原句,不影响密码本身;可直接撤回。
  • 要你做什么:无。

What changes

  • Profile page password card (PasswordCard in the console's ProfilePage.tsx): a rejected set-password or change-password now picks its text by the refusal's code through the existing passwordDoorRefusalMessages map (app-shell), the same lookup the set-password page makes. A 409 RESOURCE_CONFLICT (cloud-managed runtime, SSO-only account, pending SSO person) draws the localized sentence; any other code, or none, keeps the server's message. The lookup is own-key only, so a code that happens to spell an Object.prototype member never picks a function.
  • Auth client (@object-ui/auth createAuthClient): sendVerificationEmail, signOut and signInWithProvider now reject through toAuthError, so the thrown error carries code and status from better-auth's flat body or from the ADR-0112 envelope. The message is unchanged.
  • No third map: the password-door map is reused as the dispatch asked. Its sentence is true on this card too (no password is set or reset here for this person).
  • updateUser stays as it is: it is fenced by open draft PR fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433, and the profile password card does not call it, so this PR closes the card. That method's switch to toAuthError belongs to fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433's hunk.
  • One changeset: @object-ui/auth and @object-ui/console, patch.

Tests

  • apps/console/src/pages/system/__tests__/ProfilePage.passwordRefusal-37973.test.tsx (new, 4 cases): renders the real page and the real map. Set-password and change-password with RESOURCE_CONFLICT draw the localized sentence and read pack key auth.login.errors.managedPasswordReset. CONTROL: INVALID_PASSWORD keeps the server's message, and so does a rejection with no code.
  • packages/auth/src/__tests__/managedRefusalEnvelope-34171.test.ts: a new top-level describe (6 cases) drives the real client over a mocked fetch for the three methods. An envelope refusal keeps RESOURCE_CONFLICT / 409 / its message. CONTROL: a flat better-auth refusal keeps its own code and message.
Readings at 2d52a41

All at head 2d52a41c, run from ui/ under the shared verify lock.

  • pnpm exec vitest run packages/auth/ apps/console/src/pages/system/__tests__/ apps/console/src/pages/auth/__tests__/passwordDoorRefusal-34171.test.tsx: Test Files 65 passed (65), Tests 655 passed (655), VERDICT command-exit 0.
  • pnpm --filter @object-ui/auth type-check: exit 0. pnpm --filter @object-ui/console type-check: exit 0, after building the console's dependency closure.
  • Reverse check (fix commit first, both source files restored from the merge base with git restore --source, test files kept): Tests 8 failed | 10 passed (18). The 8 failures are the 6 new client cases and the 2 profile RESOURCE_CONFLICT cases. The 2 profile CONTROLs pass on the base, as they should. Restored with git checkout HEAD, and git diff HEAD is empty afterwards.
  • Derived gate families (dispatch-gates.mjs --commands): 37 of 39 exit 0, including pnpm --dir ui exec vitest run scripts/ (Tests 5138 passed | 2 skipped). check:query-options-erasure and check:type-check-debt were killed by a 300s local timeout on a shared box, so they are NOT MEASURED locally and CI runs both.

Acceptance notes

  • On the profile card the sentence's second half ("Sign in with the identity provider's button on the sign-in page") is written for a sign-in page, and this reader is already signed in. It is still true, and the dispatch said to reuse the map rather than add a third. A card-specific sentence would mean a new pack key in every locale. Noted here, not filed.
  • On main today the cloud-managed refusal closes set-initial-password and leaves change-password open (the cloud-managed.ts header says changing a password is /change-password's, cloud#4471). The change-password mapping covers any producer that answers that code there, and the change-password test pins the card's behaviour, not a server door.

Verification

Read first (by risk):

  1. ui/packages/auth/src/createAuthClient.ts, the signOut hunk: the rejection now carries code/status. Its message is byte-identical, and TokenStorage.clear() still runs before the throw.
  2. ui/apps/console/src/pages/system/ProfilePage.tsx, the PasswordCard catch.
  3. The new profile test.

Two-minute check: from ui/, run pnpm exec vitest run apps/console/src/pages/system/__tests__/ProfilePage.passwordRefusal-37973.test.tsx. Expect Tests 4 passed (4).


Generated by Claude Code

…de; auth client keeps the code on three more doors

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

维护者速读

席位核对 — ACCEPT · repo:objectstack#6 · head 2d52a41cebf1a558a5c508ad488808eb6dc7601f

  • Shape: draft → main, Fixes #37973 (the profile card does not call updateUser).
  • Premise measured on main 4af32b99 (dev report 7223955231): PasswordCard drew err.message raw; three client methods threw a bare Error and dropped the code.
  • Diff read by the seat: ProfilePage.tsx maps the refusal code through the existing passwordDoorRefusalMessages (own-key lookup, server message otherwise); sendVerificationEmail, signOut, social sign-in throw through toAuthError with the message unchanged for a flat body. updateUser / types.ts (fix(auth)!: createAuthClient().updateUser declares a void result, matching better-auth's receipt #37433) untouched. No new export or prop.
  • Declarations: Clause-②: no, Metadata-protocol: none, patch. No published schema or governed rule touched, so no contract review is owed (same reading as record 7219466980 on the sibling fix(auth): a cloud-managed runtime's password refusal is shown in the session's language #37965).
  • Tests: new profile describe (2 mapping + 2 CONTROLs) and 6 client cases; reverse check on base failed exactly the 8 new non-CONTROL cases.
  • Gates: check-runs at head 38 success, 13 skipped, 0 failed.
  • Noted, not filed: the reused sentence points at "the sign-in page" button, slightly off for a signed-in reader (PR acceptance notes).
  • Landing: --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Landing: seat ACCEPT at head 2d52a41cebf1a558a5c508ad488808eb6dc7601f; check-runs 38 success, 13 skipped, 0 failed. Marking ready and arming auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 17:27
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46041993507 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Live E2E UI — 失败步骤: Build the Console for the live lane

    ✗ Build failed in 7.20s
    
  • Build Core — 失败步骤: Build packages (excluding docs)(日志不可读,点进 job 看)

  • Build & E2E UI — 失败步骤: Build the Console for E2E

    ✗ Build failed in 5.82s
    
  • Lint UI — 失败步骤: Build every ui package the gates below read(日志不可读,点进 job 看)

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️ 本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 14 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Queue ejection triage (run 46041993507): every failed job is the console build, UNRESOLVED_IMPORT ../hooks/aiApiBase.js in ui/packages/app-shell/src/layout/UnifiedSidebar.tsx. This PR touches neither file; the import comes from #38005, and current main carries both UnifiedSidebar.tsx and hooks/aiApiBase.ts, so the queue tree was a stack without the module. Re-queuing once at the same head 2d52a41cebf1a558a5c508ad488808eb6dc7601f; seat ACCEPT 7224412918 unchanged.

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

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile page password card draws the server's English refusal for set-password and change-password

2 participants