Repository navigation
fix(web): a share link recognises someone whose access just changed - #736
Conversation
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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review.
|
| 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:
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
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: 
4
-
Full details: Linked Issues check
-
Explanation
Directly linked issue
#732has 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
#732or 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.
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.
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.The fix is web-only and touches J5-owned files only.
UI changes
Live testing
Pass on fb8ebbb (the head), against
j5/mainat 882256d as the base. Tested by a GPT-6-Astra Peer Agent followingj5-live-test./describereported him as unpaired, and/joinrefused "Sam" with 409name_taken./join200joined). Both runs used a fresh link made after the raise.describeLink.ts. The main repro, the server-level raise and both wordings were re-run on the head.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
FORK.md(case text and file-table row) in this PR (none edited)docs/j5/product/upstream.md(none)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/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