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

A fork count never includes a private fork, the family tree's bound included #854

Merged opened this in answer to

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

Merged

Closes #751.

shipped production is serving it for issue #751 — its issue is already done deploy b87f44f

opened this

Closes #751.

Most of #751 was already fixed on main by 9d5c89e: the Forks tab, the forks page, the API list and the front page and explore signals count only forks the viewer may read, or public forks only. This pull closes the one place still left and puts a test on every count.

What changed

  • lineageOf (src/core/following.ts), the family tree on the forks page, sets "more forks below" when the depth bound cuts the tree. It used to set this if any fork existed past the bound, a private one included. It now counts only forks the viewer may read.

Tests (test/fork-counts.test.ts, in the gate). The setup is a public repository whose only fork is private:

  • An anonymous visitor and a signed-in stranger see no Forks tab, "0 forks" on the forks page and [] from the API. The fork's owner sees the tab, "1 fork" and the fork.
  • The family tree has one node for the stranger and two for the owner.
  • frontSignals, which feeds explore and the front page, counts 0 forks.
  • Refusing test: past the tree's depth bound (six public forks deep), a private fork does not make the tree say it was cut off for a stranger, and does for its owner. It failed before the change.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs