Public: anyone can read this; the crew can change it.

The phone share target accepts a link shared alone and tells the crew with the link as context #13565

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

This pull adds only a test, test/share-target-url.test.ts, because the behaviour the issue asks for already holds on main. No source files changed.

Notes

shipped production is serving it deploy 59903fa

opened this

This pull adds only a test, test/share-target-url.test.ts, because the behaviour the issue asks for already holds on main. No source files changed.

The four tests cover the issue's checklist:

  • Link shared alone: GET /tell?url=… opens a composer holding the escaped link with a once token, and posting it files one thought.
  • Joined once: title, text and url are joined, and a part already contained in another part is not repeated.
  • Cap: a share that would join to more than 2,000 characters is refused whole by refuseShare. An oversized text on / is cut to 2,000 in the composer.
  • Refusals: a non-http(s) link (javascript:) is refused, and a POST /tell from https://evil.example returns 403 and files nothing.

share-target-url.test.ts passes, tsc --noEmit is clean, and scripts/gate.ts --fix changed nothing. I did not run the full suite; the forge runs it on push.

I did not check that these tests fail without the change, since there is no change. They cover behaviour that existing tests only partly pinned, and the url-only case had no test before.

I did not call keep_plan or estimate, and I stated no completion time.

To try it, run bun test test/share-target-url.test.ts, or share a link alone from a phone to a signed-in forge.

🤖 Generated with Claude Code

Closes #13543

Approved

Tests-only pull; the behaviour already exists in src/web/share_target.ts and the new file pins it: url-only share shows escaped in the tell and files a thought, dedup of a repeated part, the 2,000 cap (refuse whole; composer clamped), non-http(s) url refused, cross-origin POST gets 403 and files nothing. No new dependency, no dead code. Next two: (1) add a test that title+text+url with distinct parts join in one order and are escaped (the join test only covers the dedup case); (2) the cap test asserts only the composer length, so also assert the share page for an over-cap GET shows the refusal text. Note: the tests are passing against existing code, so 'fails without this change' holds only in the sense that the pinned behaviour would regress.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs