Skip to content

fix(web): a share link recognises someone whose access just changed - #736

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
fix/join-link-renews-session
Oct 27, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
fix/join-link-renews-session

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Problem

Someone already on a shared server, whose access an Owner had just changed, opened a new share link and was asked for their name. Their own name was then refused as taken. Several people hit this after being sent a second link, or after being raised to the whole server. Closes #732.

What changed

A change of level ends the person's browser sessions and marks them for renewal. The app renews such a session as it loads, but a share link opens the pairing page, which skipped renewal. The join page then described the link with the ended cookie, and the server saw a new device.

  • The join page now renews first, using the existing renewal endpoint (describeLink.ts), and then describes the link. A live session, a browser with no session, and a server renewal cannot reach all go on to describe the link exactly as before. An ordinary, unmarked pairing link still makes neither request.
  • A name refused as taken now says what to do if it is theirs. On an open link: open it on the device they paired before, or ask for a link for this device. On a one-use invite, which turns away a device already on the server: ask whoever sent it for a link for this device.

The fix is web-only and touches J5-owned files only.

UI changes

Before After
Sam opens a new open link after being raised while away Sam opens a new open link after being raised while away, before Sam opens a new open link after being raised while away, after
A name refused as taken, on an open link A name refused as taken, on an open link, before A name refused as taken, on an open link, after
A name refused as taken, on a one-use invite new A name refused as taken, on a one-use invite, after

Live testing

Pass on fb8ebbb (the head), against j5/main at 882256d as the base. Tested by a GPT-6-Astra Peer Agent following j5-live-test.

  • Reproduced first on the base. Sam, a thread Viewer, left the app. An Owner then raised him: once to Collaborator on another thread, and once to server Collaborator from People. Opening a new open link in Sam's browser asked for a name. /describe reported him as unpaired, and /join refused "Sam" with 409 name_taken.
  • On the head, both raises recognise Sam. The page shows "You are already on openclaw as Sam". The trace shows the renewal request before the describe request, and Continue joins (/join 200 joined). Both runs used a fresh link made after the raise.
  • Regressions checked:
    • a person with a live session (Priya) still joins as herself;
    • a fresh one-use invite for someone else, opened on Sam's renewed browser, says "This link is for Nora. Send it to them." with no name form;
    • a never-paired browser is still asked for a name, and a new person can join;
    • an ordinary pairing link makes no renewal or describe request.
  • The new refusal wording shows correctly on both an open link and a one-use invite.
  • First tested at a877334. The head adds only the per-link wording and moves renew-then-describe into describeLink.ts. The main repro, the server-level raise and both wordings were re-run on the head.
  • Not exercised:
    • no agent turn was taken, because the change doesn't touch the turn path;
    • the production renewal count. In dev, React StrictMode runs the page's effect twice, so each page load made two renewal calls. On an ended session they returned 200 and then 401, and both describes still recognised Sam;
    • desktop and mobile. The page is the web pairing route, and mobile renewal is already out of scope (People and access, 2026-10-19).

Code review: GPT-6.1-Sol, two rounds, both PASS. Its two non-blocking round-1 findings, the one-use wording and the missing regression test, are fixed in fb8ebbb.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (backend changes ship with focused tests)
  • UI changes: before/after screenshots above, and a video for motion or interaction (no motion, so no video)
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR (none edited)
  • Upstream product: any change to what upstream's product does has a human decision linked above and a register entry in docs/j5/product/upstream.md (none)
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md). The one entry point is the web pairing route a share link opens; desktop serves the same page; mobile pairs separately. No contract changes; same origin and credentials as before in every connection mode.
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them (none needed: People and access already says a browser on the server joins a new link as itself)

Built with Claude Opus 5.5 in Claude Code (J5 Code).

🤖 Generated with Claude Code

Jacksondr5 and others added 2 commits October 26, 2026 20:39
Opening a share link in a browser whose session J5 ended for a change of
level asked for a name, then refused the person's own name. The app renews
such a session as it loads, but the join page never did. It now renews
before describing the link. A name refused as taken also says what to do
if it is theirs.

Fixes #732

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ested

A link for one person turns away a device already on the server, so its
refusal asks for a link for this device instead of sending the person to
the device they paired before. Describing a link moves to describeLink,
with a test that a session ended for a change of level is renewed first.

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

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Oct 27, 2026 12:54am UTC

Request Review

Jacksondr5 added a commit that referenced this pull request Oct 27, 2026
@github-actions github-actions Bot added the vouch:trusted Author is trusted by repo permissions or the VOUCHED list. label Oct 27, 2026
@github-actions github-actions Bot added the size:M 30-99 effective changed lines (test files excluded in mixed PRs). label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 882256d and fb8ebbb.

Files selected for processing: 6
  • apps/web/src/j5/sharing/JoinLinkPairingSurface.tsx
  • apps/web/src/j5/sharing/describeLink.test.ts
  • apps/web/src/j5/sharing/describeLink.ts
  • apps/web/src/j5/sharing/joinPage.logic.test.ts
  • apps/web/src/j5/sharing/joinPage.logic.ts
  • apps/web/src/j5/sharing/sessionRenewal.ts

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Walkthrough

The join flow now renews the primary session before describing a link. Name-taken refusals include advice based on link use.

Changes: Join link flow

Layer / File(s) Summary
Session renewal and link description
apps/web/src/j5/sharing/sessionRenewal.ts, apps/web/src/j5/sharing/describeLink.ts, apps/web/src/j5/sharing/JoinLinkPairingSurface.tsx, apps/web/src/j5/sharing/describeLink.test.ts
describeLink renews the primary session before posting the token to the link-description endpoint. The join surface uses the helper. Tests cover renewed, missing, and unreachable-session cases.
Link-specific name-taken advice
apps/web/src/j5/sharing/joinPage.logic.ts, apps/web/src/j5/sharing/joinPage.logic.test.ts
Name-taken refusals add advice based on link use. Device links receive no added advice.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant JoinLinkPairingSurface
  participant describeLink
  participant renewPrimarySession
  participant J5Server
  JoinLinkPairingSurface->>describeLink: describeLink(token)
  describeLink->>renewPrimarySession: renewPrimarySession()
  renewPrimarySession->>J5Server: POST session renewal
  J5Server-->>renewPrimarySession: renewal response
  describeLink->>J5Server: POST link description with token
  J5Server-->>describeLink: status and response body
  describeLink-->>JoinLinkPairingSurface: description result
Loading
Merge Risk: Minimal · up to fb8eb

The reviewed join flow recognizes renewed sessions and gives appropriate guidance for open links and one-use invites. No issue identified here needs resolution before merge.

Pre-merge checks: Passed 4
Check name Status Explanation
Description check Passed The description covers the problem, implementation, UI changes, live testing, scope, regression checks, limitations, and checklist items. It is complete and aligned with the repository template.
Title check Passed The title clearly and concisely describes the primary fix: share links now recognize users whose access recently changed.
Linked Issues check Passed Directly linked issue #732 has two coding requirements. Both are implemented at the reviewed head.

(1) Renew a session J5 ended for renewal before describing a share link. describeLink.ts (head) call…
Out of Scope Changes check Passed Every changed file serves #732 or its direct test coverage. Under apps/web/src/j5/sharing/: describeLink.ts (new renew-then-describe helper) and describeLink.test.ts (its tests). JoinLinkPairingSurfac…
Full details: Linked Issues check

Explanation

Directly linked issue #732 has two coding requirements. Both are implemented at the reviewed head.

(1) Renew a session J5 ended for renewal before describing a share link. describeLink.ts (head) calls renewPrimarySession(AbortSignal.timeout(DESCRIBE_TIMEOUT_MS)) before the credentialed POST to J5_LINK_DESCRIBE_PATH. JoinLinkPairingSurface.tsx calls describeLink(token) only when the link is marked (isMarkedShareLink). An unmarked pairing link makes neither request, as the PR states. The PR reports a live repro on base 882256d and a pass on head fb8ebbb for both thread-level and server-level raises. The trace shows the renewal request before the describe request.

(2) On name_taken, show the guidance about opening the link on the device paired before. joinPage.logic.ts (head) appends nameTakenAdvice to the name_taken message. For open links (use "many") it reads: "If it is yours, open the link on the device you paired before, or ask for a link for this device." The page displays it through refusalWords in JoinSurface. Device links get no advice. One-use invites get different advice (ask the sender). The issue does not cover one-use invites, so this difference does not fail the requirement.

Unverified detail: the page now shows client-authored text. It does not show the server's LINK_NAME_TAKEN body for name_taken. I did not read the server source, so I could not confirm that the wording matches the server string word for word. The guidance itself matches the issue's intent. The live test covered the displayed text.

Tests: joinPage.logic.test.ts and describeLink.test.ts cover the new wording and the renewal and describe sequence. I did not run them.

Full details: Out of Scope Changes check

Explanation

Every changed file serves #732 or its direct test coverage. Under apps/web/src/j5/sharing/: describeLink.ts (new renew-then-describe helper) and describeLink.test.ts (its tests). JoinLinkPairingSurface.tsx moves the describe request into describeLink and drops the now-unused describe imports and the AbortSignal parameter from the local post helper. joinPage.logic.ts and joinPage.logic.test.ts add the per-link name_taken guidance. sessionRenewal.ts adds an optional AbortSignal to renewPrimarySession so describeLink can time out the renewal. None of these changes alters behavior outside the join page or the named refusal. The PR reports no contract or server changes. I did not verify the FORK.md and upstream-register checklist items, since they fall outside coding scope.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Jacksondr5
Jacksondr5 merged commit 386e0ca into j5/main Oct 27, 2026
37 of 39 checks passed
@Jacksondr5
Jacksondr5 deleted the fix/join-link-renews-session branch October 27, 2026 01:20
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026

This branch was successfully deployed

1 active deployment
Preview — fb8ebbbb Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sharing: a person whose access changed is asked for a name by their next link, then told it is taken

1 participant