Skip to content

fix(i18n): describe session transfer as a one-time code, not a link - #8236

Open
JohnMcLear wants to merge 1 commit into
developfrom
fix/8173-session-transfer-copy
Open

JohnMcLear wants to merge 1 commit into
developfrom
fix/8173-session-transfer-copy

Conversation

@JohnMcLear

Copy link
Copy Markdown
Member

Fixes #8173

Root cause

The home page settings dialog (src/templates/index.html, keys in src/locales/en.json) told users to copy a link and open it on the target device to transfer their session. What welcome.ts actually does is different:

  • it copies only the bare one-time UUID returned by POST /tokenTransfer, which has to be pasted into the "Receive session" tab (#codeInput) of the other browser;
  • tokenTransfer.ts moves only the author token and the prefsHttp preferences cookie. No login/Express session is moved.
  • the code works once and expires after 5 minutes (GHSA-vqfp-p66c-xrp9 hardening).

Fix

Copy-only change. I updated the English values of the existing keys (same approach as #7989) so translatewiki marks the translations as outdated. Key names, DOM ids and welcome.ts are unchanged.

key before after
index.transferSession 1. Transfer session 1. Create a transfer code
index.transferSessionNow Transfer session now Create transfer code
index.transferSessionDescription …copy a link to a page that will transfer your session… Move your Etherpad author identity (so your edits stay attributed to you) and your preferences… one-time transfer code… Other data, such as sign-in sessions, is not transferred.
index.copyLink 2. Copy link 2. Copy the transfer code
index.copyLinkDescription …copy the link… …copy the transfer code… can only be used once and expires after 5 minutes.
index.copyLinkButton Copy link to clipboard Copy code to clipboard
index.transferToSystem 3. Copy session to new system 3. Paste the transfer code
index.transferToSystemDescription Open the copied link in the target browser… Paste the transfer code you copied on the other browser or device into the field below.
index.receiveSessionDescription …receive an Etherpad session… delete your current session …receive your Etherpad author identity and preferences… replaces the author identity currently used in this browser

The tab titles ("Transfer session" / "Receive session") stay as they are.

Tests

New spec src/tests/frontend-new/specs/session_transfer_copy.spec.ts checks the rendered English strings on both tabs.

  • Before the fix (develop, chromium): 2 failed. Example: Expected substring: "code", Received string: "Transfer your current session to browser or device by clicking the button below. This will copy a link to a page…" and Expected: "3. Paste the transfer code", Received: "3. Copy session to new system".
  • After the fix: 2 passed.
  • vitest: 50 files / 840 tests passed. tsc --noEmit: clean.

Note: the existing welcome.spec.test.ts never runs, because its name doesn't match the *.spec.ts testMatch glob. That's why the new spec is a separate file.

Overlap

#8180 (#8172) adds index.sessionTransferError next to these keys in en.json. Whichever PR merges second will get a trivial adjacent-line conflict.

🤖 Generated with Claude Code

https://claude.ai/code/session_012kA75NPq8nGRidAwhPXeCi

…8173)

The home-page settings dialog told users to copy and open a "link" to
transfer their "session", but the flow copies a bare one-time UUID that
has to be pasted into the Receive session tab, and only moves the author
token and pad preferences (not a login/Express session). Update the
English copy of the existing keys to describe the real code-based
workflow, its single-use/5-minute lifetime, and exactly what is moved.

Add a Playwright spec asserting the rendered strings.

Fixes #8173

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012kA75NPq8nGRidAwhPXeCi
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Clarify session transfer as a one-time code

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Correct session-transfer copy to describe one-time codes, author identity, preferences, and
 exclusions.
• Clarify codes are single-use, expire after five minutes, and must be pasted.
• Add Playwright coverage for transfer and receive dialog wording.
Diagram

sequenceDiagram
  actor User
  participant Dialog as Settings Dialog
  participant Locale as English Locale
  participant API as Transfer API
  User->>Dialog: Open transfer tab
  Dialog->>Locale: Load English copy
  Locale-->>Dialog: Code-based guidance
  User->>Dialog: Create transfer code
  Dialog->>API: POST /tokenTransfer
  API-->>Dialog: One-time code
  User->>Dialog: Copy and paste code
  Dialog->>API: Redeem code
  API-->>Dialog: Identity and preferences
Loading
High-Level Assessment

Changing the existing English locale values and adding rendered-copy coverage is the optimal approach. Renaming localization keys or modifying the transfer implementation would create unnecessary translation churn and runtime risk because the underlying workflow is already correct.

Files changed (2) +65 / -9

Bug fix (1) +9 / -9
en.jsonCorrect English session-transfer terminology and guidance +9/-9

Correct English session-transfer terminology and guidance

• Replaces misleading link and full-session language with instructions for creating, copying, and pasting a one-time transfer code. Clarifies the five-minute, single-use lifetime, the author identity and preferences being transferred, and the exclusion of sign-in sessions.

src/locales/en.json

Tests (1) +56 / -0
session_transfer_copy.spec.tsAdd browser coverage for session-transfer copy +56/-0

Add browser coverage for session-transfer copy

• Adds Playwright tests for both dialog tabs, including mocked transfer-code creation. Assertions verify code-oriented wording, author identity scope, copy and paste instructions, and the absence of obsolete link terminology.

src/tests/frontend-new/specs/session_transfer_copy.spec.ts

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session transfer UI describes a link/full session but copies a code and limited state

1 participant