Skip to content

fix(app-shell,console): the invitation inbox's accept routes an unverified address to verification, and the verify screen says a link was sent only when one was - #34929

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34706-accept-invitation-followups
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34706-accept-invitation-followups

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #34706

repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:邀请收件箱里的「接受」被以「邮箱未验证」拒绝时,控制台不再弹出英文错误,而是像接受页一样转到验证邮件页(链接验证后回到该邀请的接受页);该动作的 AI 说明写明了这个条件;验证提示页只在注册入口(确实已发邮件)说「已发送」,登录和接受邀请入口改为「请发送验证链接」,按下按钮后才显示已发送;README 写明嵌入接受页或动作运行时的宿主必须声明 /verify-email-prompt 路由。
  • 为什么改:fix(plugin-auth,app-shell)!: while mail is live, accepting an invitation needs a verified address #34666 之后邮件可投递时接受邀请需要已验证邮箱,这三处没有跟上,新成员会卡住或被误导(卡 accept-invitation follow-ups: the inbox action, the verify-email prompt copy, and the embedding host's route #34706)。
  • 风险与回滚:低。拒绝路由只认一个错误码,其它拒绝照旧弹提示;文案改动新增两个翻译键(11 个语言)。英文资源包预算余量只剩约 143 字节。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx 的 refused(新增的错误码分支);ui/packages/app-shell/src/views/RecordDetailView.tsx 的 refused;ui/apps/console/src/pages/auth/VerifyEmailPromptPage.tsx 的 sentOnArrival。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiActionDoor-27611.test.tsx apps/console/src/pages/auth/__tests__/verificationCallback-10893.test.tsx,预期两个文件全绿(含 objectstack#34706 的 6 个用例)。
  • 需要你做的:无,席位落地。

What changes

Item 1 — the invitation inbox's Accept (sys_invitation.accept_invitation).

  • (b) Where the console surfaces a refused type: 'api' action: both api handlers, useConsoleActionRuntime's apiHandler (list rows) and RecordDetailView's (record header), each reading a non-2xx through one refused step that already had one per-code rule (the entitlement dialog, entitlementDialogFromError). A second rule now sits beside it: a body whose code is EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION (read with the existing isAcceptNeedsVerifiedEmail) navigates to /verify-email-prompt?email=ADDRESS&redirect=/accept-invitation/INVITATION_ID and answers { success: false } with no error, which the runner reads as "no toast". It applies through the action door and through the direct call alike (the door relays the target's flat vendor body as-is). The redirect is the accept page for that invitation (the subject row's id), so after verifying the person lands where the accept page's own refusal lands. Every other refusal reads exactly as before. No action metadata key, no packages/spec change, no server change.
  • (a) ai.description now states the server rule on main: while the deployment delivers email, the caller's address must be verified; an unverified caller is refused with that code and nothing is written. No translated bundle carries ai.description (check:i18n in sync).
  • Helpers in orgErrorMessage.ts: verifyEmailPromptPath(email, redirect) and invitationVerifyEmailPromptPath(email, invitationId). AcceptInvitationPage.tsx is left as main has it (see Acceptance notes).

Item 2 — /verify-email-prompt copy. Measured which arrivals send a mail before reaching the page:

arrival mail sent before arrival? evidence
/register (verification required) yes better-auth 1.7.12 sign-up: sends when emailVerification.sendOnSignUp ?? requireEmailVerification
/login (EMAIL_NOT_VERIFIED) no, unless the deployment sets emailVerification.sendOnSignIn (plugin-auth forwards it only when set; unset by default) better-auth 1.7.12 sign-in: the send is inside if (emailVerification.sendOnSignIn)
accept page / inbox action (refused accept) no the plugin-auth refusal hook writes and sends nothing

The old page said "We sent a verification link…" and "Sent to:" on every arrival. Now RegisterPage adds ?sent=1 (VERIFICATION_SENT_PARAM, verifyEmailPromptQuery.ts) and keeps today's copy. Every other arrival reads "Your email address has not been verified yet. Send a verification link to ADDRESS, then click the link to verify your account." with a "Send verification email" button, and shows "Sent to:" and the spam hint only after the button has sent the mail. With no sent key the page says nothing about a sent mail. New keys auth.verifyEmail.sendDescription and auth.verifyEmail.sendButton in all 11 built-in locales (key-parity tests green).

Item 3 — the embedding host's route. @object-ui/app-shell README gains "Hosting the invitation pages: declare /verify-email-prompt": the accept page and the action handlers navigate there with email and redirect; a host that mounts either one must declare the route. The changeset says the same.

Changeset .changeset/34706-accept-invitation-followups.md: @objectstack/platform-objects, @object-ui/app-shell, @object-ui/console, @object-ui/i18n, all patch.

Tests

  • useConsoleActionRuntime.apiActionDoor-27611.test.tsx: new top-level describe (objectstack#34706): the refusal through the door, and through the direct call, navigates to the prompt with the account's address and the invitation's accept page, returns { success: false }, no refresh. CONTROL: YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION keeps its sentence and navigates nowhere. The file's react-router-dom mock now hands back a navigate spy; the mocked user gains an email.
  • RecordDetailView.apiActionDoor-27611.test.tsx: the same three cases on the record page, reading the navigation from a useLocation probe under the MemoryRouter.
  • verificationCallback-10893.test.tsx: new describe: an arrival with no sent asks to send and claims no mail (no "We sent", no "Sent to:", no spam hint, no request made); pressing the button sends to the address and only then shows "Sent to:" and the spam hint. CONTROL: sent=1 keeps the "we sent" copy and "Resend". The sign-up redirect test also asserts sent=1.
  • Existing tests that drove the prompt as the sign-up's resend now pass sent=1 (verificationCallback-10893, handoffVerificationMail-30157); handoffVerificationMail-30157's promptAt takes the sent flag for the /register hops.

Acceptance notes

  • In-flight overlap: fix(plugin-auth)!: accepting, declining and listing an invitation need a verified email address on every deployment #34883 (draft) makes the same refusal unconditional (every deployment) and adds it to decline. Two effects on this PR if it lands first or after: the ai.description sentence "While this deployment delivers email" then needs its condition dropped, and reject_invitation would answer the same code. The console routing here is keyed on the code, not the action, so a refused decline from the inbox already goes to verification too. This branch first refactored AcceptInvitationPage.tsx onto the new helper; overlap-check reported a textual conflict with fix(plugin-auth)!: accepting, declining and listing an invitation need a verified email address on every deployment #34883 on that file, so the page is left as main has it (overlap-check exit 0 on the final head).
  • Eager English budget. i18n-locale-en measures 61,857 gzipped bytes against the 62,000 ceiling (headroom 143). Removing the two new strings from the built chunk and re-gzipping gives 61,818, so they cost about 39 bytes. Other open PRs that add English keys (feat(ui): a timesheet list view, an editable row × weekday entry grid #34925 shares the locale files) draw on the same 143 bytes.
  • The sign-up arrival's sent=1 assumes the vendor default (sendOnSignUp follows requireEmailVerification). A deployment that sets sendOnSignUp: false while requiring verification would see "We sent" after sign-up although nothing was sent. That was already the case before this PR; noted, not changed.
  • resendFailed ("Cannot resend verification email") still says "resend" when the first send fails on an arrival that sent nothing. It only appears after the button is pressed.
  • No content/docs/** page documents the default auth pages; the package README is where the host-route rule lives.

Verification

All readings on 3c8835f8c (branch merged with main at fc5913e11).

Touched-area suites and type-checks
  • pnpm --dir ui exec vitest run packages/i18n/ apps/console/src/pages/auth/ packages/app-shell/src/console/organizations/: Test Files 157 passed (157), Tests 2445 passed, 13 skipped; lock VERDICT command-exit 0.
  • every useConsoleActionRuntime*.test.tsx and RecordDetailView*.test.tsx (120 files): Test Files 120 passed (120), Tests 925 passed (925); VERDICT command-exit 0.
  • pnpm --filter @objectstack/platform-objects exec vitest run: Test Files 123 passed (123), Tests 2046 passed.
  • type-check: @object-ui/app-shell exit 0, @object-ui/console exit 0, @object-ui/i18n exit 0; @objectstack/platform-objects typecheck exit 0.
  • ESLint, per-package config as Lint UI runs it, on every changed ui file: app-shell 0 errors, console 0 errors (warnings only, all in lines this diff does not touch).
Ablation: each core change mutated, red, restored

Each through node scripts/ablation-replace.mjs (anchor hit once, blob changed, restored to the HEAD blob, git diff HEAD empty):

  • useConsoleActionRuntime.tsx routing branch disabled: the two hand-over cases red (2 failed, 12 passed); restored.
  • RecordDetailView.tsx routing branch disabled: the two hand-over cases red (2 failed, 8 passed); restored.
  • VerifyEmailPromptPage.tsx sentOnArrival forced true: the two no-mail cases red (2 failed, 10 passed); restored.
  • RegisterPage.tsx sent=1 deleted: three cases red across verificationCallback-10893 and handoffVerificationMail-30157 (3 failed, 20 passed); restored.
Eager closure and locale catalogues (console built on this head)
  • pnpm --dir ui run check:eager-closure: exit 0; "chunk i18n-locale-en 60.4 KB measured / 60.5 KB ceiling (headroom 0.1 KB)"; eager-closure.json: 61,857 gzipped bytes; ceiling PER_CHUNK_GZIP_CEILINGS['i18n-locale-en'] 62,000, not edited.
  • pnpm --dir ui run check:eager-locale-catalogues: exit 0 (en the one eager catalogue).
Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 71 families. 70 ran with exit 0. check:i18n and check-plugin-teardown-shape --self-test first answered exit 3 (CLI closure not built; a pinned commit missing from the shallow clone) and exit 0 once the prerequisite was met. check:dual-build-cjs-loads answered exit 3 (it needs every package's dist, i.e. a full pnpm build): NOT MEASURED locally, CI runs it. --ran reconciliation: 71 derived, 70 run, 1 NOT-MEASURED, 0 UNRUN. Also pnpm --dir ui run check:new-line-citations: 0 new citations. node scripts/pm/overlap-check.mjs: exit 0.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 3 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json d576509c80575197b3218aeb1f55884e5ed06ea6 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgQsdnyS4QdR8stjDa

L1 review (L1-d) · 2026-11-17T16:58Z

L1: REWORK
Head-sha: 3c8835f8cf74ea69652b8af1c86f53bae3e39ecd

Read against claim 6951290353 and report 6954290964 on #34706. Merge base fc5913e1, 24 files, +386/-37.

  • Not governed: check-governed-merges --branch reports 0 paths and 423 lines.
  • CI at this head: 58 success, 10 skipped, 0 failed.

This is paper only. Once the claim is amended, this head is ACCEPT with no push.

What holds

  • Closing keyword. Fixes #34706 is right; all three items and their pins are done.
    1. The inbox action. Both type: 'api' handlers add one code-keyed rule to their existing refusal step: useConsoleActionRuntime's apiHandler, and RecordDetailView's door and direct legs through one refused() helper. On EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION, they navigate to /verify-email-prompt?email=…&redirect=/accept-invitation/<id> and answer { success: false } with no toast. Every other refusal still goes through apiActionRefusalResult, and a CONTROL case pins that.
      • accept_invitation's ai.description states main's condition. That text is agent-facing only and no generated bundle carries it.
      • No metadata key, spec change or server change was needed, so the claim's stop condition did not fire.
    2. The verify page's copy. Only RegisterPage sets ?sent=1, and the dev measured that only the sign-up has sent a mail by then. Every other arrival asks the person to send. "Sent to:" and the spam hint appear only after sentOnArrival || resent.
      • The existing hand-off pins now pass &sent=1 where the sign-up arrival is meant. That is the stated behaviour change, not a weakening.
      • The two new keys exist in all 11 locales.
    3. Hosts. The app-shell README ("Hosting the invitation pages") and the changeset name the route and its email / redirect keys.
  • Changeset. It names all four packages whose src/** moved (platform-objects, app-shell, console, i18n, all patch). Its sentences match the diff. Clause-②: no and Metadata-protocol: none match the claim.
  • Tests. Real commands with counts. Four ablations, each red and restored to HEAD: the hook routing, the RecordDetailView routing, sentOnArrival, and the register sent=1.
  • Scope. AcceptInvitationPage.tsx is left as main has it (an overlap with draft fix(plugin-auth)!: accepting, declining and listing an invitation need a verified email address on every deployment #34883). The claim allows that, since it may narrow.

Must-fix

  • M1 (paper): the claim surface needs an amendment. The claim names the action file, "the console's api-action refusal path", VerifyEmailPromptPage.tsx and its locale strings, the item 3 docs, and card-named tests. These paths are outside it:
    • ui/apps/console/src/pages/auth/RegisterPage.tsx (the sent=1 mark);
    • ui/apps/console/src/pages/auth/verifyEmailPromptQuery.ts (new);
    • ui/packages/app-shell/src/console/organizations/orgErrorMessage.ts. The claim said to reuse isAcceptNeedsVerifiedEmail from it; the PR adds verifyEmailPromptPath and invitationVerifyEmailPromptPath.
    • Four existing test files, which are not card-named:
      • ui/apps/console/src/pages/auth/__tests__/handoffVerificationMail-30157.test.tsx
      • ui/apps/console/src/pages/auth/__tests__/verificationCallback-10893.test.tsx
      • ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiActionDoor-27611.test.tsx
      • ui/packages/app-shell/src/views/RecordDetailView.apiActionDoor-27611.test.tsx

Should-fix

None.

Notes

  • N1: The rule is keyed on the code alone, so any type: 'api' action refused with it hands over to verification, and the mail's link returns to /accept-invitation/<row id>. Today only accept_invitation can produce that code from the inbox. If fix(plugin-auth)!: accepting, declining and listing an invitation need a verified email address on every deployment #34883 makes decline refusable too, its row id is still the invitation's, so the hand-over still lands on the right accept page. The report notes reject_invitation's description will then owe the condition.
  • N2: A deployment that sets emailVerification.sendOnSignIn will now see "send a link" after a sign-in refusal that did send one. Treating an unknown arrival as not sent is the stated default ("a page that cannot tell must not claim a mail went out"). The report notes that the opposite case on sign-up (sendOnSignUp: false with verification required) predates this PR.
  • N3: The branch's commits carry no Co-Authored-By / Claude-Session trailer pair, and their subjects read wip:. The seat ruled at 16:36Z not to rewrite them. The queue squash takes the PR title, which is conventional.
  • N4: This PR adds about 39 B to the eager i18n-locale-en chunk (61,857 / 62,000 on its own tree). Combined with feat(ui): a timesheet list view, an editable row × weekday entry grid #34925's 8 keys it would cross the current ceiling, so whichever lands second waits for console budget: raise the eager English catalogue ceiling (i18n-locale-en) by 30%, per the maintainer ruling #34927 (62,000 → 80,600), per the seat's ruling of 2026-11-17.

Landing: not governed, and all checks are green on this exact head. After the M1 amendment, area o3-H lands it. A later push owes a delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgQsdnyS4QdR8stjDa

L1 review (L1-d), same-head re-read · 2026-11-17T16:59Z

L1: ACCEPT
Head-sha: 3c8835f8cf74ea69652b8af1c86f53bae3e39ecd

The head is unchanged since REWORK 6954916178, so the diff, the body and the check-runs read there still stand: 58 success, 10 skipped, 0 failed.

Must-fix

None. M1 is closed by claim amendment 6954932254 on #34706. It adds:

  • RegisterPage.tsx;
  • verifyEmailPromptQuery.ts;
  • orgErrorMessage.ts (the two path builders);
  • the four existing test files, under AGENTS.md's shared-harness rule (ruling record 6583487846).

Every path in the PR's 24-file list is now inside the claim as amended.

Should-fix

None.

Notes

N1 to N4 from 6954916178 stand:

Landing: not governed (0 of 24 paths, 423 lines), all checks green. Area o3-H lands it. A later push owes a delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa

Red check read (area o3-H) · 2026-11-17T17:20Z

Test UI (5/16) failed on head d9061596 (the main merge, K was 17; job 134215170711) before any test ran: ##[error]The action 'Fetch this commit's history and the base branch' has timed out after 14 minutes. It is a checkout timeout on the runner, not this PR's code (same failure #34930 hit at 16:4xZ). The area re-runs the failed jobs once when run 44132310398 concludes; a second identical failure goes to the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgQsdnyS4QdR8stjDa

L1 review (L1-d), delta read · 2026-11-17T17:53Z

L1: ACCEPT
Head-sha: d906159650a2b815e1e4e2d61516d2864befda59

The new head is merge-only.

  • Parents: d9061596 has parents 3c8835f8 (ACCEPT 6954952912) and origin/main d576509c.
  • Same diff: the PR's net diff against its merge base is identical, line for line, at both heads. It is the same 24 files, +386/-37, and the merge edited no file of the PR.
  • Verdicts: everything in 6954916178 and 6954952912 stands. That includes claim amendment 6954932254 and notes N1 to N4.
  • CI at this head: 58 success, 10 skipped, 0 failed.

Landing: not governed, and all checks are green on this exact head. Area o3-H lands it. #34925 is not armed, so this PR takes the eager-budget headroom first. A later push owes a delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa

Landing (area o3-H) · 2026-11-17T17:54Z

Reading Value
L1 ACCEPT (L1-d delta read 6956304927 on the merge-only head, after same-head ACCEPT 6954952912 and REWORK 6954916178; M1 closed by claim amendment 6954932254) on head d906159650a2b815e1e4e2d61516d2864befda59, no should-fix
CI on that head 58 success, 10 skipped (path filter), 0 failed or pending (Test UI (5/16) passed on its one re-run after a runner checkout timeout, 6955502918); mergeable_state: clean
check-governed-merges.mjs --pr 34929 NOT governed, 0 of 24 paths; 423 changed lines ≤ 3000
K (d576509c..origin/main, first-parent) 9 (< 15); main was merged at K=17 before this reading
Trailers the original commits lack the Co-Authored-By / Claude-Session pair (history rewrite refused); seat ruling 16:36Z: lands as is, no gate names them
Eager en budget measured green by CI on this merged tree; #34925 not armed, so this PR takes the headroom first

State change: ready + auto-merge enabled. Fixes #34706.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 17:54
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit c81f498 Nov 17, 2026
112 of 114 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34706-accept-invitation-followups branch November 17, 2026 18:18
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 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.

accept-invitation follow-ups: the inbox action, the verify-email prompt copy, and the embedding host's route

2 participants