Skip to content

fix(web): show an invited account's email once on the restore Choose step - #4928

Merged
Quick104 merged 3 commits into
mainfrom
fix/restore-invited-account-duplicate-email
Nov 21, 2026
Merged

Quick104 merged 3 commits into
mainfrom
fix/restore-invited-account-duplicate-email

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none
Other clients: N/A (web admin only; the Apple, Android, and Roku apps have no backup restore screen)

On the backup restore Choose step, an account created from an invitation shows its email twice: once as the row's name and again as the muted contact line beside it. On a one-line row the repeated line also keeps the name capped at 45% of the row, so two invited accounts whose addresses differ only after the @ are both cut short and read the same. This change shows the address once, and the name then uses the whole row.

An invited account is created with its username and email set to the same address (internal/invitations/service.go), and the restore preview names an account by its username, or by its email when it has none (internal/backup/users_plan.go). AccountRow left the username out of the contact line when it matched the name, but always added the email.

Approach

AccountRow leaves the email out of the contact line when it is exactly the row's name. The comparison is exact on purpose: the browser and the database don't lowercase every letter the same way, so a case-insensitive match could hide an email the database treats as a different sign-in name. The name's text is also isolated in <bdi>, so on a right-to-left page an address that starts with digits reads in order now that no contact line repeats it. Since #4788 the 45% cap applies only when the contact line is non-empty, so these names now get the whole row. Rows whose email differs from the name are unchanged, and a matched account keeps its pending summary ("40 plays · 3 ratings to add") without the repeated address. The Choose step's search still matches the email.

Validation

  • Reproduced and verified by rendering the real Choose step component in a temporary dev-only page with seeded accounts, before and after this change, both on main. The accounts cover two invited accounts whose addresses differ only in the domain, an account with a separate username and email, a matched invited account with data to add, an email that differs from its username only in case, an account with no username, and an invited address that starts with digits. A second list covers invited addresses too long for one line, a long matched account, a merge into a differently named account, and an admin. Before, at a 680 px row, both invited names and both repeated lines are cut short and read the same. After, every name shows in full at 680, 720, 786, 800, and 880 px, in English and Arabic; an address too long for the row wraps instead. The digit-first address reads in order in Arabic, and the case-only email still shows. On the phone, below the one-line switch, and at extra-large text, only the repeated line goes. No page scrolls horizontally at any size. A dev deployment wasn't available for this run, so the captures don't come from a full restore flow. The temporary page isn't part of this change.
  • Format, lint, typecheck, and the admin-backups tests pass on this head. Web lint, format check, typecheck and build, and bundle budget passed on the first commit. In the full web test run, 13 of 3,094 tests failed on a loaded machine, 11 of them 5-second timeouts and none in the restore code. Run alone, all but one passed; that one (AdminCollections "refuses more than 100 at a time") passes and fails on repeated runs, with and without this change.
  • No test added: this is a display change, which "Decide what to test" leaves out.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/restore-invited-email/

Risks

None identified. The change only affects which text the row shows; selection, the restore request, and the server are untouched.

Follow-ups

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

Council review

Background review: 2 rounds, last reviewed 51841e6

Member Round 1 (87ca800) Round 2 (51841e6)
Sol (gpt-6.2-sol, xhigh) 8/10 cancelled before reviewing; not retried after the merge
Opus (claude-opus-5-5, high) 9/10 8/10
Gemini (gemini-4-neon, xhigh) unavailable (provider quota) unavailable (provider quota on retry)

Visual review: 2 rounds. Round 1 compared the change on main before #4788 merged; round 2 compared it on #4788's final head. The captures were retaken on this head, including the two rows the review fixes change, which the members didn't review again.

Member Round 1 Round 2
Sol better, 7/10 better, 8/10
Opus better, 7/10 better, 8.5/10
Gemini worse, 5/10 better, 8/10

Fixed: round 1 of the visual review found that, without #4788, removing the repeat left invited names cut short beside empty space; the change was then verified on top of #4788, which has since merged. Sol's background review found an address that starts with digits reading out of order in Arabic once its in-order copy was gone (S1), and a case-insensitive match hiding an email the database treats as different (S2); both are fixed in 2e1534a. Answered: Opus noted that the username entry in the contact list can never add text (O1); it predates this PR, and dropping it changes no output. Open after merge: Opus's round 2 found that WebKit drops the "…" when a name cut short beside a contact line sits in the <bdi> (O2), confirmed in Playwright WebKit; #5007 fixes it, together with #4837, by giving the name its own direction instead of the <bdi>. The remaining visual notes predate this change: a com left on its own line when a phone wraps a long address, and a capped Latin name losing its start in Arabic, which is tracked in #4837. The Arabic contact line aligning away from its name was fixed on main by #4878.

AI Disclosure

  • Harness: Claude Code, run from T3 Code
  • Tool(s): Claude Code subagents for code review; T3 Code delegated tasks for the visual and background reviews (Codex, Claude Code, Antigravity); Playwright (Chromium) for captures
  • Model(s): claude-opus-5-5 (implementation and review), claude-sonnet-5-5 (review), gpt-6.2-sol and gemini-4-neon (visual and background review)
  • Involvement: Fully AI-generated
  • Adversarial review: a multi-agent code review at xhigh and a two-round, three-model visual review; the plan round was skipped because the fix is a two-line guard. See Council review.

🤖 Generated with Claude Code

…step

An invited account's username is its email address, and the restore
preview labels an account with its username (or its email when it has no
username). AccountRow still added the email to the contact line, so the
row showed the address twice. Leave the email out when it matches the
label, ignoring case as sign-in does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

AccountRow now omits the email from the contact line when it matches the row label. It also wraps the account label in a <bdi> element to isolate its text direction.

Changes: Account row rendering

Layer / File(s) Summary
Contact and label rendering
web/src/pages/admin-backups/RestoreUsers.tsx
AccountRow omits the email when it matches the row label. It wraps the account label in <bdi>.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

Merge Risk: Minimal · up to 51841

This change only hides a repeated email on the restore Choose step and isolates the account label's text direction. It has no data or security impact and is easy to revert, so it is ready to merge.

Security architecture risk: Minimal · up to 51841

The change adjusts duplicate-email display and text direction. It does not change account selection, restore permissions, or persistent state.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: invited accounts' email is shown once on the restore Choose step. It matches the raw summary, which says the email is omitted from the contact line when it matches the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is specific and on-topic. It names the affected component (AccountRow on the backup restore Choose step), explains why the invited account email appears twice, describes the exact-matc…
Full details: Title check

Explanation

The title names the main change: invited accounts' email is shown once on the restore Choose step. It matches the raw summary, which says the email is omitted from the contact line when it matches the row label. The title is specific and uses the conventional prefix format.

Full details: Description check

Explanation

The description is specific and on-topic. It names the affected component (AccountRow on the backup restore Choose step), explains why the invited account email appears twice, describes the exact-match rule and the bdi isolation, and lists validation and risks. It clearly relates to the changeset in RestoreUsers.tsx.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8b48fedc-02f1-4cb8-b515-20819ba4df81
Commits

Reviewing files that changed from the base of the PR and between 980e455 and 51841e6.

Files selected for processing: 1

  • web/src/pages/admin-backups/RestoreUsers.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T05:55:21.498072Z 51841e6 New commits
🔒 Security Review ✅ Completed 2026-11-21T05:58:08.476345Z 51841e6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 21, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review (claude-opus-5-5, reviewed 87ca800)

One nit, inline. Nothing blocking. The new comparison is correct for every way an account's label is built: internal/backup/users_plan.go sets it to the username, or to the email when the username is empty, and nothing rewrites it later for account items. Search (matchesFilter in restoreGroups.ts) still matches on the email, so hiding it from the row doesn't make the account harder to find. The checkbox's accessible name and the label's title stay item.label. The dir="ltr" reasoning in the contact-line comment still holds, because when there's no pending summary the line is either the email or absent. No other web page shows a restore account's email, and the report step shows labels only.

Reviewed with Claude Opus 5.5 (claude-opus-5-5) in Claude Code.

// without regard to case, so a case-only difference is still the same address.
const contact = [
pending,
account.username !== item.label ? account.username : null,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (simplification, existing code next to this change): this username entry can never add anything. users_plan.go:216-220 makes the label the username whenever the username is non-empty, so account.username !== item.label is true only when the username is "", and .filter(Boolean) then drops that empty string. The comment this PR adds describes exactly that case, which makes the dead entry more confusing than before.

Suggested repair: drop the entry so the array is [pending, account.email.toLowerCase() !== item.label.toLowerCase() ? account.email : null]. This changes no output.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaving this line alone. It predates this PR, the PR doesn't change it, and dropping it wouldn't change any output, so it belongs in a separate cleanup. The email entry now uses the same exact comparison, so the two lines read alike.

🤖 Claude Code (claude-opus-5-5)

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review (gpt-6.2-sol, reviewed 87ca800)

AI disclosure. Codex in T3 Code reviewed the pinned diff and traced the restore paths. It checked text direction with FriBidi and identifier equality with PostgreSQL 18.6 via PGlite.

Quick104 and others added 2 commits November 21, 2026 00:53
…ail shown

Compare the email to the row's label exactly. Lowercasing in the browser
could hide an email the database treats as a different sign-in name,
such as one whose case differs in a Greek final sigma. An invited
account's username and email are the same string, so exact equality
still drops the repeat.

Isolate the name with <bdi> so it reads in its own direction: on a
right-to-left page an address that starts with digits no longer shows
its domain first, now that no contact line repeats it in order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review (claude-opus-5-5, reviewed 51841e6)

One new finding, a nit, inline. The exact email comparison and the duplicate-email fix are correct. The label is the exact username, or the email when there is no username (internal/backup/users_plan.go), so the equality holds on every account path that reaches AccountRow. Omitted accounts have no account and render elsewhere. Search (restoreGroups.ts), the checkbox's aria-label, title, and the details panel read item.label or the raw fields, so the change doesn't affect them.

My round-1 finding O1 (the username entry in the contact array can't add text) is resolved: it predates this PR, changes no output, and is out of scope.

AI disclosure

Review written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code.

@Quick104
Quick104 merged commit af1c8db into main Nov 21, 2026
26 checks passed
@Quick104
Quick104 deleted the fix/restore-invited-account-duplicate-email branch November 21, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant