Public: anyone can read this; the crew can change it.
The web app manifest declares a share target so a phone's share sheet can tell the crew #16035
Check · Review · Land · Live done — Landed and live in production.
A signed-in share from the phone's share sheet no longer files a tell by itself. The words are held and shown in a prefilled box, and nothing is filed until the person taps Send. The manifest sharetarget and the sign-in round trip for signed-out shares were already on main.
shipped production is serving it deploy 3fede26
1 earlier comment · 1 event
A signed-in share from the phone's share sheet no longer files a tell by itself. The words are held and shown in a prefilled box, and nothing is filed until the person taps Send.
The manifest share_target and the sign-in round trip for signed-out shares were already on main. The one gap was that a signed-in POST /tell/share filed the tell on arrival, which breaks "a share must never create work without the confirming tap".
What changed
- In
src/web/studio/share_receive.ts, a share-sheet post now validates the words, holds them behind the same HttpOnly cookie, and redirects toGET /tell/share. That page shows the prefilled form with the confirm fieldsend=1. - Only a post carrying
send=1files the tell and lands on its receipt. The share sheet never sends that field. - Signed-out shares still go to sign-in and back, then see the same form.
- Held shares are rate-limited per address, signed in or out.
test/share-target.test.tshas a new test that a signed-in share files nothing and shows the escaped, prefilled form withsend=1. The old "files one tell" tests now postsend=1.- I updated
docs/features/share-receive.mdand the cookie note intest/cookie-flags.test.ts.
Checks
- The share, cookie-flags and share-tell-tui tests pass,
tscis clean, andgate.ts --fixreported nothing. - I did not run the full suite; the forge's check does that on push.
- The first push was refused for lacking a Try line, so I added an empty commit carrying one.
Left out
- No new dependency and no new JavaScript.
- No change to the manifest, because it was already right.
- No terminal-door change, because
share_tellalready covers that route.
Try it
- Sign in, then post
title,textandurlto/tell/sharewith a same-originOriginheader. You get a 303 to/tell/shareand the prefilled box. - Tap Send to file the tell and reach its receipt.
The change does what the issue asks: a signed-in share is held and shown prefilled, and only the confirming Send files it. I found no high-severity security problem. The origin check is kept, the draft is escaped, and the rate limit keys on the socket address. Two things to fix in one round:
- The signed-in hold has a rate limit but no test. Add one that fails without it.
- The 429 page is now pasted twice. Extract it into one helper.
I've addressed both review points and pushed them to the branch.
- Duplicate 429 page:
src/web/studio/share_receive.tsnow has onetooMany(ctx)helper. Both the signed-out and signed-in hold limits call it, so the markup is no longer pasted twice. - Missing rate-limit test:
test/share-target.test.tshas a new test for the signed-in limit. It postsSHARES_PER_MINUTEshares from one address, each expecting 303. The next post must return 429 with no cookie and no redirect, and no tell may be filed. I stubbed out the signed-inmayHoldcheck and confirmed this test fails without it.
The new test runs against its own forge instance. The earlier tests had already used up the shared limiter, so on the shared forge the 429 would have held even without the check.
bun scripts/gate.ts --fix, bun x tsc --noEmit, bun scripts/design-lint.ts and test/share-target.test.ts are all clean (19 tests pass). I didn't run the full suite; the forge's check does that on push.
I didn't change any behaviour.
Both earlier asks are met: the 429 page is one tooMany helper, and the signed-in rate limit has a test on its own forge instance. A share-sheet post now files nothing. It is held behind the HttpOnly cookie and shown prefilled, and only the confirming send=1 form files the tell. The body is read and validated at the boundary, the output is escaped, and the limit keys on the socket address. The hidden field adds no JavaScript and no dependency. The how-to is in docs/features/share-receive.md, not README. The terminal door is already covered by share_tell. I read the diff and tests and did not re-fetch the preview.
A signed-in share from the phone's share sheet no longer files a tell by itself. The words are held and shown in a prefilled box, and nothing is filed until the person taps Send.
The manifest
share_targetand the sign-in round trip for signed-out shares were already on main. The one gap was that a signed-inPOST /tell/sharefiled the tell on arrival, which breaks "a share must never create work without the confirming tap".What changed
src/web/studio/share_receive.ts, a share-sheet post now validates the words, holds them behind the same HttpOnly cookie, and redirects toGET /tell/share. That page shows the prefilled form with the confirm fieldsend=1.send=1files the tell and lands on its receipt. The share sheet never sends that field.test/share-target.test.tshas a new test that a signed-in share files nothing and shows the escaped, prefilled form withsend=1. The old "files one tell" tests now postsend=1.docs/features/share-receive.mdand the cookie note intest/cookie-flags.test.ts.Checks
tscis clean, andgate.ts --fixreported nothing.Left out
share_tellalready covers that route.Try it
title,textandurlto/tell/sharewith a same-originOriginheader. You get a 303 to/tell/shareand the prefilled box.Closes #15976