Skip to content

feat(server): one view-only link several people can join a thread with - #585

Merged
Jacksondr5 merged 2 commits into
j5code/share-3b-people-and-linksfrom
j5code/share-3c-open-link
Oct 13, 2026
Merged

Jacksondr5 merged 2 commits into
j5code/share-3b-people-and-linksfrom
j5code/share-3c-open-link

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

A share link is made for one named person, so putting a thread in front of several people means making and sending a link each. Jackson asked for one link a member can put in a chat (#541).

What changed

  • An open link (apps/server/src/j5/sharing/OpenLinks.ts, J5 migration 36). A member who holds Manage access makes one for a thread. It is J5's own token, 32 random bytes, stored as a hash. Each person who opens it becomes a new guest with a View grant on that thread and an ordinary single-use share link of their own, so from there they are a guest like any other.
  • The name. The person types it. It is recorded as one they gave themselves (nameSelfGiven) until a member renames them with j5.sharing.renamePerson.
  • A self-given name is one line of visible characters: no control characters, line breaks, format characters (zero-width characters, the soft hyphen, direction marks and tag characters, so also emoji joined by a zero-width joiner), private-use, unassigned or surrogate code points, and no more than two combining marks in a row. Letters of any script are fine, with their accents and vowel signs. It is checked in the contract and again in the service. Upstream's lists of links and devices show such a person as Unconfirmed name: <name>. A name a member types is not restricted. Square brackets are refused too, as for every name (feat(server): a member brings a guest in with a share link #582), and the route's refusal says so.
  • Collaborate needs a confirmed name. putGrant refuses collaborate for a guest whose name is self-given, with an error that says to confirm the name first.
  • Limits. Seven days, at most fifty people a link, and j5.sharing.revokeOpenLink stops new people joining. j5.sharing.listOpenLinks lists each link with who joined.
  • The join route, POST /api/j5/sharing/join, takes no sign-in. It trusts the token alone and answers a made-up, revoked, expired, full or deleted-thread link in the same words and status (404). A request with no usable name gets a 400. There is no rate limit: the token cannot be guessed, a wrong one costs one indexed read, and a real one is capped.
  • A member's browser is refused. The route takes no sign-in, but a browser sends its cookie: a request carrying a live session that is not a guest's gets a 409 saying the link is for guests, and no one is recorded (Jackson, 2026-10-12).
  • A route that says what a link opens, without spending it (Jackson, 2026-10-12): POST /api/j5/sharing/describe, no sign-in, body { link } holding a named person's credential or an open link's token. For a link that would work now it answers with the kind of link, the server's name, what it opens by title (thread and project, or project) with its level, and for a named link the name the member gave that person. A named link opens nothing itself, so opens lists what that person's grants reach, which can be empty. Each entry carries the icon a person chose for its project (projectIcon, plain data). It gives no ids, no paths, no one who shared and no one who joined. Any other link, and any pairing link that is not a guest's, gets the join route's one 404. It only reads. A member's browser gets the same answer as anyone.
  • What the settled UI design asks of this layer. createOpenLink takes the same four lifetimes as a named link. The describe answer carries expiresAt. renamePerson (the layer below) is also how a self-given name is confirmed: it clears the mark, so there is no separate confirm request. A member asking who is on a thread is told of its open links that can still be joined, and each guest's nameSelfGiven and joinedByOpenLink; a guest asking is told of no links. A joiner's own pairing link lasts an hour, since the browser that asked uses it at once.
  • A join under a name someone already has is refused with a 409 (name_taken), the owner's name included. The link is judged first, so a link that does not work gets its usual 404 whatever name is sent and learns nothing about names. Opening a link twice under one name is therefore refused the second time; under two names it is two guests, as before.
  • An open link waits for the owner's name. createOpenLink is refused with OwnerNameRequiredError while the owner has none, as creating a guest is in the layer below.
  • A join checks before it writes. The link is found only while its thread exists, and the count, the new person, their grant and their link are written in one transaction, one join at a time.

The definitions change with it, as the issue says: Shared server gains "An open link" and AC26 to AC28, numbered after AC25 so earlier numbers stand, and Shared conversations AC1 says a self-given name is confirmed before that person is given Collaborate.

Decisions to check

  • Opening a link twice makes two guests. Nothing ties them together; a member removes the extra.
  • Thread only. No open link for a project.
  • The cap of fifty is a limit of the build, named in D33 and left out of the definition.
  • The route is registered only where sharing is wired in, read once when routes are built, so J5's route tests need no sharing services.

Live testing

Run by the builder on an isolated j5-live-test server at this branch's code (default flags), with raw requests; there is no UI.

  • Live: a member made an open link for a thread. A made-up token got 404. The real token returned a credential, which paired a guest whose own grants were one View grant and who was refused createOpenLink. After revoking, the same token got the same 404. The people list showed the joiner with nameSelfGiven: true.
  • Live, after the review round (tip eb98ca7733): a name with a newline, a right-to-left override and a bell got 400, and "José 李雷" joined. Twenty-five wrong tokens each got 404 and the real token then worked. Upstream's pairing-link list showed both joiners as Unconfirmed name: …. Collaborate was refused with NameNotConfirmedError, then allowed once the name was confirmed. After the thread was deleted, the same token got 404 and no person was added.
  • Live (tip dbe30f6462): a join sent from a signed-in member's browser got 409 with that message, recorded no one, and left the member's session as it was; the same token without a cookie then joined.
  • Live (tip f9dded7b53): describe answered for a named link (twice, the same) and for an open link, with the server's real name and the thread's and project's titles; a made-up link and a used link got the join route's 404; the named link then paired and afterwards described as 404; the open link then joined and still described.
  • Live (tip d45a1101bd): names holding tag characters, a zero-width space, a soft hyphen and five stacked marks each got 400; a decomposed "José" and a Devanagari name joined.
  • Live (tip 94fc36215e): a 24-hour join link expired in 24 hours; describe of a 30-day named link said 30 days; a member saw the thread's open link and the guest saw none.
  • Live (tip eacc8f0220): a join under the owner's name got 409; a made-up link got the same 404 with a taken name and with a free one; a second join under the same name in another case got 409.
  • Live (tip 704423b494): createOpenLink was refused with OwnerNameRequiredError on a server whose owner had no name, and made the link once the name was set.
  • After the rebase onto j5/main: by test, the sharing counter moves when a join link is made, joined with or revoked, and not for a refused join. The live pass on tip 3ed8990140 is described in feat(server): a member brings a guest in with a share link #582.
  • By test only: thirteen kinds of link that would not work answering identically, a member's ordinary pairing link revealing nothing and still pairing after, expiry, the fifty-person cap, eight people joining at once for two places, constant wording across refusals, malformed bodies.
  • Not exercised live: opening the link in a browser, since there is no join page yet.

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 UI in this PR
  • 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 — D33 notes the one J5 route that takes no sign-in
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md) — server and contracts only; no client has a join page. Revoke is the way out
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them

Tests: apps/server/src/j5/sharing/OpenLinks.test.ts, through the real route, upstream's real auth and a real database.

Claude Opus 5.5, Claude Code

🤖 Generated with Claude Code

@Jacksondr5
Jacksondr5 added this pull request to stack #583 October 13, 2026 02:01
@vercel

vercel Bot commented Oct 13, 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 13, 2026 5:53am UTC

Request Review

@github-actions github-actions Bot added the vouch:trusted Author is trusted by repo permissions or the VOUCHED list. label Oct 13, 2026
@github-actions github-actions Bot added the size:XL 500-999 effective changed lines (test files excluded in mixed PRs). label Oct 13, 2026
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from 8bed788 to eb98ca7 Compare October 13, 2026 02:36
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from eb98ca7 to dbe30f6 Compare October 13, 2026 02:47
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from dbe30f6 to 1f03b39 Compare October 13, 2026 02:53
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from 1f03b39 to f9dded7 Compare October 13, 2026 03:07
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from f9dded7 to d45a110 Compare October 13, 2026 03:18
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from d45a110 to 94fc362 Compare October 13, 2026 04:00
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch 2 times, most recently from 145b26f to e6bf9d6 Compare October 13, 2026 04:16
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from e6bf9d6 to eacc8f0 Compare October 13, 2026 04:28
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from eacc8f0 to a33695d Compare October 13, 2026 04:41
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from a33695d to a248b9e Compare October 13, 2026 04:54
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from a248b9e to 0a295de Compare October 13, 2026 04:58
Jacksondr5 and others added 2 commits October 13, 2026 01:50
A share link is made for one named person, so putting a thread in front
of a group means a link each.

A member who holds Manage access makes an open link for a thread, for a
lifetime they choose. It is J5's own token, kept as a hash. Each person
who opens it types a name and becomes a new guest with a View grant on
the thread and a single-use share link of their own. The name is marked
as one they gave themselves until a member renames them, and they cannot
be given Collaborate before then. A link brings in at most fifty people
and can be revoked.

Joining takes no sign-in: the route trusts the token alone, answers every
link it will not take in the same words, refuses a browser signed in as
a member, and checks everything before it writes, in one transaction. A
second route says what either kind of link opens without spending it.

A member asking who is on a thread is told of its open links and of
unconfirmed names.

Refs #541

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The join route says so in its refusal, and its tests cover both brackets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Jacksondr5
Jacksondr5 force-pushed the j5code/share-3c-open-link branch from e5fc7d5 to 6979fbc Compare October 13, 2026 05:53
@Jacksondr5
Jacksondr5 removed this pull request from stack #583 October 13, 2026 15:20
@Jacksondr5
Jacksondr5 added this pull request to stack #605 October 13, 2026 15:20
@Jacksondr5
Jacksondr5 marked this pull request as ready for review October 13, 2026 20:39
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 21 billable files and costs up to $5.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 21 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 61 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 12382813-f16d-4e2b-b95a-f398db828618
📥 Commits

Reviewing files that changed from the base of the PR and between aa21971 and 6979fbc.

📒 Files selected for processing: 21
  • apps/server/src/j5/a2a/J5AuthenticatedRoutes.ts
  • apps/server/src/j5/a2a/Migrations.test.ts
  • apps/server/src/j5/a2a/Migrations.ts
  • apps/server/src/j5/a2a/migrations/036_OpenLinks.ts
  • apps/server/src/j5/sharing/GuestGate.ts
  • apps/server/src/j5/sharing/GuestPairing.ts
  • apps/server/src/j5/sharing/OpenLinkHttp.ts
  • apps/server/src/j5/sharing/OpenLinks.test.ts
  • apps/server/src/j5/sharing/OpenLinks.ts
  • apps/server/src/j5/sharing/People.test.ts
  • apps/server/src/j5/sharing/People.ts
  • apps/server/src/j5/sharing/PersonAccess.test.ts
  • apps/server/src/j5/sharing/PersonAccess.ts
  • apps/server/src/j5/sharing/sharingRpc.ts
  • apps/server/src/j5/wsRpc.ts
  • docs/j5/product/features/shared-conversations.md
  • docs/j5/product/features/shared-server.md
  • docs/j5/product/upstream.md
  • packages/contracts/src/j5.ts
  • packages/contracts/src/j5/clientRpcPermissions.ts
  • packages/contracts/src/j5/sharing.ts
  • 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 8ed8498 into j5/main Oct 13, 2026
58 of 73 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/share-3c-open-link branch October 13, 2026 20:40

This branch was successfully deployed

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

Labels

size:XL 500-999 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.

1 participant