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

A fork that follows upstream shows what the last sync took, in one sentence #14093

Closed opened this
Closed without merging

scout/forge:scout/14067-a-fork-that-follows-upstream-shows-what → main 9 commits fork 4 threads · 4 unresolved

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
14 files changed +247 −14
docs/features/README.md +1
@@ -31,6 +31,7 @@ Read with the guide page [What a forge is](../guide-what-a-forge-is.md).
3131 - [An app with no description says its README](readme-description.md)
3232 - [Arcade carts](arcade-carts.md)
3333 - [How far behind a followed fork is](fork-behind.md)
34 - [What a fork's last sync took](fork-last-sync.md)
3435 - [Changelog](changelog.md)
3536 - [Tell the crew from any shell with ssh and tell](tell-from-ssh.md)
3637 - [/docs](docs-link.md)
docs/features/fork-last-sync.md added +16
@@ -0,0 +1,16 @@
1 # What a fork's last sync took
2
3 A fork's following card has a **Last sync** row: `3 changes from alice/app on
4 2026-11-16`. It is stored when the sync ran (table `fork_last_sync`, one row per
5 fork) and read back as it was; the page never asks git.
6
7 - Every path that moves the fork writes it: **Take updates**, an automatic
8 follow of the parent's push, and a repository that follows an address. All go
9 through `recordSync` in `src/core/fork_last_sync.ts`.
10 - A merge counts the upstream's commits it brought, not the merge commit.
11 - A take that found nothing new is stored too, and reads `Nothing new from
12 alice/app on 2026-11-16`: whoever pressed Take updates gets an answer. A take
13 that failed leaves the row alone. A fork that never synced has no row.
14 - In the terminal, the fork's followed card (palette: the repository's forks
15 screen) shows the same as `Took 3 changes from alice/app on 2026-11-16.`
16 under the follow-mode sentence.
src/actions/upstream_follow.ts +3
@@ -84,6 +84,7 @@ import { providerForOrigin } from "../origins/credential.ts";
8484 import { basicHeader, gitAuthEnv, redact, secretsIn } from "../origins/credentials.ts";
8585 import { vettedEnv } from "../origins/git-mirror.ts";
8686 import { forkFollowMode } from "../core/fork_follow.ts";
87 import { recordSync } from "../core/fork_last_sync.ts";
8788 import { settleOntoFollowed } from "../core/upstream_settle.ts";
8889 import { openIssue } from "./issues.ts";
8990 import { migrateUrl } from "./migrate.ts";
@@ -634,6 +635,7 @@ async function checkTarget(app: App, repo: Repo, follow: Target): Promise<Result
634635 app, repo, dir, main, staged, upstreamLabel(follow.url), follow.byId,
635636 forkFollowMode(app.db, repo.id) === "take-updates",
636637 );
638 if (settled.moved === "fast-forward") await recordSync(app, repo, upstreamLabel(follow.url), main, settled.tip);
637639 main = settled.tip;
638640 }
639641 const behind = await aheadCount(dir, main, staged);
@@ -751,6 +753,7 @@ async function forwardTo(
751753 const ref = `refs/heads/${repo.defaultBranch}`;
752754 if (!(await runGit(["update-ref", ref, staged, main], { cwd: dir })).ok) return false;
753755 const upstream = upstreamShort(url);
756 await recordSync(app, repo, upstream, main, staged, behind);
754757 app.bus.append({
755758 kind: "push",
756759 repoId: repo.id,
src/actions/upstream_sync.ts +4
@@ -20,6 +20,7 @@ import { listCrewRoles } from "../core/agents.ts";
2020 import { commitIdentity } from "../core/commit_identity.ts";
2121 import type { Repo } from "../core/repos.ts";
2222 import { getFollow, type UpstreamFollow } from "../core/upstream_follow.ts";
23 import { recordSync } from "../core/fork_last_sync.ts";
2324 import { settleOntoFollowed } from "../core/upstream_settle.ts";
2425 import type { User } from "../core/users.ts";
2526 import { merge, mergeable, resolveOid } from "../git/merge.ts";
@@ -74,10 +75,12 @@ export async function takeFromFollowed(
7475 const noted = (behind: number): void => target.note({ at, tip, behind, error: "" });
7576 if (settled.moved !== undefined) {
7677 noted(0);
78 await recordSync(app, repo, label, main, tip);
7779 return ok({ updated: true, merged: false, from: main, to: tip });
7880 }
7981 if (settled.standing?.kind !== "diverged") {
8082 noted(0);
83 await recordSync(app, repo, label, main, main, 0);
8184 return ok({ updated: false, merged: false, from: main, to: main });
8285 }
8386 const landed = await merge(dir, {
@@ -97,6 +100,7 @@ export async function takeFromFollowed(
97100 return err(e.kind === "base_moved" ? { kind: "moved" } : { kind: "git", message: e.kind === "git" ? e.message : "unsafe" });
98101 }
99102 noted(0);
103 await recordSync(app, repo, label, main, tip);
100104 app.bus.append({
101105 kind: "push",
102106 repoId: repo.id,
src/core/following.ts +6 −1
@@ -18,6 +18,7 @@
1818 * so it is read here as the push it amounts to.
1919 */
2020
21 import { recordSync } from "./fork_last_sync.ts";
2122 import { carryApproval } from "./carry_approval.ts";
2223 import type { Database } from "bun:sqlite";
2324 import type { EventBus, ForgeEvent } from "./events.ts";
@@ -402,13 +403,15 @@ export async function takeUpdates(
402403 if (relation === undefined) return err({ kind: "git", message: "no parent" });
403404 if (expect !== undefined && relation.parentTip !== expect)
404405 return err({ kind: "upstream_moved", tip: relation.parentTip, message: MOVED });
405 if (relation.state === "synced" || relation.state === "ahead")
406 if (relation.state === "synced" || relation.state === "ahead") {
407 await recordSync(forge, fork, `${parent.ownerName}/${parent.name}`, relation.forkTip, relation.forkTip, 0);
406408 return ok({
407409 updated: false,
408410 merged: false,
409411 from: relation.forkTip,
410412 to: relation.forkTip,
411413 });
414 }
412415 if (relation.state === "behind") {
413416 const moved = await fastForwardFork(forge, fork, parent, author.id, expect);
414417 if (moved.ok) return ok({ ...moved.value, merged: false });
@@ -448,6 +451,7 @@ export async function takeUpdates(
448451 message: landed.error.kind === "git" ? landed.error.message : "unsafe",
449452 });
450453 }
454 await recordSync(forge, fork, `${parent.ownerName}/${parent.name}`, again.forkTip, tip);
451455 forge.bus.append({
452456 kind: "push",
453457 repoId: fork.id,
@@ -625,6 +629,7 @@ export async function fastForwardFork(
625629 ? ok({ updated: false, from: from ?? "", to })
626630 : err("diverged");
627631 const tip = synced.value.to;
632 await recordSync(forge, fork, `${parent.ownerName}/${parent.name}`, from ?? "", tip);
628633 forge.bus.append({
629634 kind: "push",
630635 repoId: fork.id,
src/core/fork_last_sync.ts added +55
@@ -0,0 +1,55 @@
1 /** What a fork's last sync with its parent took, stored when the sync ran and read as it was. */
2
3 import type { Database } from "bun:sqlite";
4 import { aheadCount } from "../git/merge.ts";
5 import { repoDir } from "../git/repos.ts";
6 import type { Repo } from "./repos.ts";
7
8 export interface LastSync {
9 readonly changes: number;
10 readonly upstream: string;
11 readonly at: string;
12 }
13
14 export function noteLastSync(db: Database, repoId: string, s: LastSync): void {
15 db.query(
16 `INSERT INTO fork_last_sync (repo_id, changes, upstream, at) VALUES (?1, ?2, ?3, ?4)
17 ON CONFLICT(repo_id) DO UPDATE SET changes = excluded.changes, upstream = excluded.upstream, at = excluded.at`,
18 ).run(repoId, s.changes, s.upstream, s.at);
19 }
20
21 /**
22 * A sync moved `fork`'s default branch from `from` to take everything up to `upTo`: store how many
23 * commits that brought, once, so every path that moves a fork (a take, a followed push, a followed
24 * address) says the same thing. A take that found nothing new is stored too (changes = 0), so the
25 * person who pressed it reads "Nothing new" with the date they asked.
26 */
27 export async function recordSync(
28 forge: { readonly db: Database; readonly reposRoot: string },
29 fork: Repo,
30 upstream: string,
31 from: string,
32 upTo: string,
33 /** The count, when the caller already has it. */
34 known?: number,
35 ): Promise<void> {
36 const changes = known ?? (await aheadCount(repoDir(forge.reposRoot, fork.ownerName, fork.name), from, upTo));
outdated

Principle 1/the issue: this guard is what drops the "Nothing new" sentence. Write the row for changes = 0 as well (the CHECK already allows 0) and have lastSyncFact/lastSyncWords say "Nothing new from X on DATE" for it; the no-op test then asserts the date moves and the words read Nothing new.

37 noteLastSync(forge.db, fork.id, { changes, upstream, at: new Date().toISOString() });
38 }
39
40 export function lastSyncOf(db: Database, repoId: string): LastSync | undefined {
41 return (
42 db
43 .query<LastSync, [string]>("SELECT changes, upstream, at FROM fork_last_sync WHERE repo_id = ?1")
44 .get(repoId) ?? undefined
45 );
46 }
47
48 /**
49 * What the last sync took, as a fact for a labelled row: "3 changes from alice/app on 2026-11-16".
50 */
51 export const lastSyncFact = (s: LastSync): string =>
52 `${s.changes === 0 ? "Nothing new" : s.changes === 1 ? "1 change" : `${s.changes} changes`} from ${s.upstream} on ${s.at.slice(0, 10)}`;
53
54 /** The same as one sentence, for the terminal: "Took 3 changes from alice/app on 2026-11-16." */
55 export const lastSyncWords = (s: LastSync): string => `${s.changes === 0 ? "" : "Took "}${lastSyncFact(s)}.`;
src/core/migration-pins/20261116120000-fork-last-sync.pin added +1
@@ -0,0 +1,1 @@
1 0a0ae72bd371f43ae6cdbd90c0d77a43a0708022b473177c4614eafdb9cb3f41
src/core/migrations/20261116120000-fork-last-sync.ts added +10
@@ -0,0 +1,10 @@
1 // What a fork's last update from its parent took (#14067): one row per fork, written when the sync
2 // runs and replaced by the next. Additive.
3 export default `
4 CREATE TABLE fork_last_sync (
5 repo_id TEXT PRIMARY KEY REFERENCES repo(id) ON DELETE CASCADE,
6 changes INTEGER NOT NULL CHECK (changes >= 0),
7 upstream TEXT NOT NULL,
8 at TEXT NOT NULL
9 );
10 `;
src/tui/screens/forks.ts +9 −2
@@ -25,6 +25,7 @@ import { FOLLOW_CHOICES, FOLLOW_PHRASE, FOLLOW_WORD, FOLLOWS_NOTHING, followChoi
2525 import { FOLLOW_MODE_REFUSALS, convergeWords, followModeOf, followStanding, setFollowMode, takeOrTell, takeWords } from "../../actions/follow.ts";
2626 import { incomingOf, type Incoming } from "../../actions/follow_incoming.ts";
2727 import { convergeFollowed, followedAs, followedOf } from "../../actions/upstream_sync.ts";
28 import { lastSyncOf, lastSyncWords } from "../../core/fork_last_sync.ts";
2829 import { forkOffers } from "../../core/fork_offers.ts";
2930 import { agoWords } from "../../actions/follow_words.ts";
3031 import { STANDING_EVENTS } from "../../core/standing_events.ts";
@@ -95,6 +96,8 @@ export function followingRows(
9596 relation: ForkRelation | undefined,
9697 converge: Converge | undefined,
9798 mode?: ForkFollowMode,
99 /** What the last sync took (`lastSyncWords`), when one is stored. */
100 lastSync?: string,
98101 ): ForkRow[] {
99102 if (relation === undefined) return [];
100103 const { parent } = relation;
@@ -116,6 +119,7 @@ export function followingRows(
116119 heading: "",
117120 },
118121 ...(mode === undefined ? [] : [{ repo: parent, name: ` ${FOLLOW_CHOICES[mode].sentence}`, words: "", heading: "" }]),
122 ...(lastSync === undefined ? [] : [{ repo: parent, name: ` ${lastSync}`, words: "", heading: "" }]),
119123 ...(converge === undefined
120124 ? []
121125 : [
@@ -175,6 +179,7 @@ export function forksScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
175179 let followed: ReturnType<typeof followedAs> | undefined;
176180 let open: Pull | undefined;
177181 let mode: ForkFollowMode | undefined;
182 let synced: string | undefined;
178183 /** The one plain line the page and MCP say: how this fork follows, and when it last took. */
179184 let standing: string | undefined;
180185 /**
@@ -247,7 +252,9 @@ export function forksScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
247252 standing = await followStanding(f.app, repo, f.user);
248253 failed = getRepoById(f.db, repo.id)?.origin?.fetchError ?? "";
249254 mode = relation === undefined ? undefined : await followModeOf(f.app, repo);
250 following = followingRows(relation, converge, mode);
255 const last = lastSyncOf(f.db, repo.id);
256 synced = last === undefined ? undefined : lastSyncWords(last);
257 following = followingRows(relation, converge, mode, synced);
251258 offered = forkOffers(f.db, repo, f.user).map((o) => ({
252259 repo,
253260 name: `offered #${o.number} ${o.title}`,
@@ -275,7 +282,7 @@ export function forksScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
275282 // The converge issue just opened or found is the line Enter opens.
276283 const e = took.ok ? undefined : took.error;
277284 if (typeof e === "object" && e.kind === "conflict" && "converge" in e && relation !== undefined) {
278 following = followingRows(relation, e.converge, mode);
285 following = followingRows(relation, e.converge, mode, synced);
279286 state.index = following.length - 1;
280287 }
281288 ctx.toast(words.message, words.tone === "danger" ? "danger" : "default");
src/web/pages/following.ts +7 −1
@@ -29,6 +29,7 @@ import {
2929 convergeState,
3030 type Converge,
3131 } from "../../crew/converge.ts";
32 import { lastSyncFact, lastSyncOf } from "../../core/fork_last_sync.ts";
3233 import { MINE_ANCHOR, type Lineage, type LineageNode } from "../../core/following.ts";
3334 import {
3435 parentReleases,
@@ -49,7 +50,7 @@ import { proposesViaFork } from "../../origins/fork-route.ts";
4950 import { field, readForm } from "../form.ts";
5051 import { html, when, type Html } from "../html.ts";
5152 import { flashOrJson } from "../layout.ts";
52 import { badge, btn, icon, row, time, type Tone } from "../ui.ts";
53 import { badge, btn, icon, row, statusRow, time, type Tone } from "../ui.ts";
5354 import { disconnectedOn } from "./frozen.ts";
5455
5556 /** The first node (parents before children) the viewer owns and is not looking at. */
@@ -421,6 +422,11 @@ export function followingCard(
421422 }
422423 if (parent.detached === null && relation.action !== "none")
423424 prose.push(html`<p class="muted small">${relation.words}</p>`);
425 const lastSync = lastSyncOf(ctx.app.db, repo.id);

Both doors: this sentence is page-only. Add the matching terminal screen in src/tui/ and docs/features/<name>.md. The No door: escape is not acceptable here. Design: this is a fact beside the relation line, so check it reads as a dl row of the card rather than a second muted paragraph saying nearly the same (principles 1 and 7).

426 if (lastSync !== undefined)
427 prose.push(
428 html`<dl class="status-rows" data-last-sync>${statusRow("Last sync", html`${lastSyncFact(lastSync)}`)}</dl>`,
429 );
424430 if (foot !== null) prose.push(html`<p class="muted small">${foot}</p>`);
425431 const words = followModeWords(following.mode, parentName);
426432 prose.push(
src/web/pages/security.ts +3 −10
@@ -26,7 +26,9 @@ import { notFoundPage, settingsLayout, signInFirst } from "../chrome.ts";
2626 import { field, readForm } from "../form.ts";
2727 import { html, type Html } from "../html.ts";
2828 import { flashTo, page } from "../layout.ts";
29 import { badge, btn, time } from "../ui.ts";
29 import { badge, btn, statusRow, time } from "../ui.ts";
30
31 export { statusRow };
3032 import { accountSections } from "./origins.ts";

Clean: this re-export exists only so other pages keep importing statusRow from the security page. Move those importers to ../ui.ts and delete this line; a shim between a page and the shared component is dead weight.

3133
3234 const DAY_MS = 86_400_000;
@@ -107,15 +109,6 @@ function newAccountsRow(db: Database, nowMs: number): Html {
107109 );
108110 }
109111
110 /** One line of the page: what it is, how it stands, what you can do. */
111 export function statusRow(label: string, state: Html, action: Html | null = null, id?: string): Html {
112 return html`<div class="status-row" ${id === undefined ? null : html`id="${id}"`}>
113 <dt>${label}</dt>
114 <dd>${state}</dd>
115 <dd class="status-act">${action}</dd>
116 </div>`;
117 }
118
119112 const shieldButton = (to: ShieldState, label: string, variant?: "primary"): Html =>
120113 html`<form method="post" action="/settings/security/shield" class="inline">
121114 <input type="hidden" name="state" value="${to}" />
src/web/ui.ts +9
@@ -1488,3 +1488,12 @@ export function tlComment(body: Html): Html {
14881488 }
14891489
14901490 export { when };
1491
1492 /** One line of a `status-rows` list: what it is, how it stands, what you can do. */
1493 export function statusRow(label: string, state: Html, action: Html | null = null, id?: string): Html {
1494 return html`<div class="status-row" ${id === undefined ? null : html`id="${id}"`}>
1495 <dt>${label}</dt>
1496 <dd>${state}</dd>
1497 <dd class="status-act">${action}</dd>
1498 </div>`;
1499 }
test/follow-last-sync.test.ts added +117
@@ -0,0 +1,117 @@
1 /** A fork that follows its parent says what the last sync took, stored when it ran (#14067). */
2 import { afterAll, beforeAll, expect, test } from "bun:test";
3 import { mkdtemp, rm } from "node:fs/promises";
4 import { tmpdir } from "node:os";
5 import { join } from "node:path";
6 import { takeUpdates } from "../src/actions/forks.ts";
7 import { commitToBranch, createRepo, forkRepo } from "../src/actions/repos.ts";
8 import { createApp, type App } from "../src/app.ts";
9 import { setForkFollowMode } from "../src/core/fork_follow.ts";
10 import { lastSyncOf, lastSyncWords } from "../src/core/fork_last_sync.ts";
11 import { getRepo, type Repo } from "../src/core/repos.ts";
12 import { createSession } from "../src/core/sessions.ts";
13 import { createUser, type User } from "../src/core/users.ts";
14 import { serve, type Servers } from "../src/http/server.ts";
15 import { promote } from "./helpers/members.ts";
16
17 let dataDir: string;
18 let app: App;
19 let servers: Servers;
20 let alice: User;
21 let bob: User;
22 let lib: Repo;
23 let fork: Repo;
24 let cookie: string;
25
26 beforeAll(async () => {
27 dataDir = await mkdtemp(join(tmpdir(), "forge-last-sync-"));
28 app = createApp({ dataDir, port: 0 });
29 servers = await serve(app);
30 const a = await createUser(app.db, { origin: "seed", trusted: true, username: "alice", email: "[email protected]", password: "a-good-passphrase", adminIfFirst: true });
31 const b = await createUser(app.db, { origin: "seed", trusted: true, username: "bob", email: "[email protected]", password: "a-good-passphrase" });
32 if (!a.ok || !b.ok) throw new Error("user");
33 alice = a.value;
34 bob = b.value;
35 promote(app.db, bob);
36 const r = await createRepo(app, alice, { name: "lib", visibility: "public" });
37 if (!r.ok) throw new Error("repo");
38 lib = r.value;
39 await commitToBranch(app, alice, lib, { message: "Start", files: [{ path: "README.md", content: "# lib\n" }] });
40 const f = await forkRepo(app, bob, lib);
41 if (!f.ok) throw new Error("fork");
42 fork = getRepo(app.db, "bob", "lib")!;
43 // Pushes would move the fork on their own; hold that so the take is the sync.
44 setForkFollowMode(app.db, fork.id, "dont-follow");
45 cookie = `forge_session=${createSession(app.db, bob.id).token}`;
46 }, 60_000);
47
48 afterAll(async () => {
49 servers.stop();
50 app.close();
51 await rm(dataDir, { recursive: true, force: true });
52 });
53
54 const page = async () => (await (await fetch(`${servers.url}/bob/lib`, { headers: { cookie } })).text());
55
56 test("the words, one change and many", () => {
57 expect(lastSyncWords({ changes: 3, upstream: "alice/lib", at: "2026-11-16T10:00:00.000Z" })).toBe("Took 3 changes from alice/lib on 2026-11-16.");
58 expect(lastSyncWords({ changes: 1, upstream: "alice/lib", at: "2026-11-16T10:00:00.000Z" })).toBe("Took 1 change from alice/lib on 2026-11-16.");
59 expect(lastSyncWords({ changes: 0, upstream: "alice/lib", at: "2026-11-16T10:00:00.000Z" })).toBe("Nothing new from alice/lib on 2026-11-16.");
60 });
61
62 test("no row, no sentence: a fork that never synced says nothing", async () => {
63 expect(lastSyncOf(app.db, fork.id)).toBeUndefined();
64 expect(await page()).not.toContain("data-last-sync");
65 });
66
67 test("a take that moved three commits is stored and shown as a Last sync row", async () => {
68 for (const n of [1, 2, 3])
69 await commitToBranch(app, alice, lib, { message: `c${n}`, files: [{ path: `f${n}.txt`, content: `${n}\n` }] });
70 const took = await takeUpdates(app, bob, fork);
71 expect(took.ok && took.value.updated).toBe(true);
72 const stored = lastSyncOf(app.db, fork.id)!;
73 expect(stored.changes).toBe(3);
74 expect(stored.upstream).toBe("alice/lib");
75 const html = await page();
76 expect(html).toContain(`3 changes from alice/lib on ${stored.at.slice(0, 10)}`);
77 expect(html).toContain("<dt>Last sync</dt>");
78 }, 60_000);
79
80 test("a take that found nothing new is stored as Nothing new, with the date it ran", async () => {
81 const before = lastSyncOf(app.db, fork.id)!;
82 const again = await takeUpdates(app, bob, fork);
83 expect(again.ok && again.value.updated).toBe(false);
84 const after = lastSyncOf(app.db, fork.id)!;
85 expect(after.changes).toBe(0);
86 expect(after.at > before.at).toBe(true);
87 expect(await page()).toContain(`Nothing new from alice/lib on ${after.at.slice(0, 10)}`);
88 }, 60_000);
89
90 test("a failed take leaves the row as it was", async () => {
91 const before = lastSyncOf(app.db, fork.id)!;
92 await commitToBranch(app, alice, lib, { message: "e1", files: [{ path: "e1.txt", content: "1\n" }] });
93 const refused = await takeUpdates(app, bob, fork, "0".repeat(40));
94 expect(refused.ok).toBe(false);
95 expect(lastSyncOf(app.db, fork.id)).toEqual(before);
96 await takeUpdates(app, bob, fork);
97 }, 60_000);
98
99 test("a merge counts the parent's commits, not the merge", async () => {
100 await commitToBranch(app, bob, fork, { message: "mine", files: [{ path: "mine.txt", content: "m\n" }] });
101 for (const n of [1, 2])
102 await commitToBranch(app, alice, lib, { message: `d${n}`, files: [{ path: `g${n}.txt`, content: `${n}\n` }] });
103 const took = await takeUpdates(app, bob, fork);
104 expect(took.ok && took.value.merged).toBe(true);
105 expect(lastSyncOf(app.db, fork.id)!.changes).toBe(2);
106 }, 60_000);
107
108 test("a followed push that fast-forwards the fork writes the row too", async () => {
109 setForkFollowMode(app.db, fork.id, "take-updates");
110 // recordSync runs before the fork's own push event, so that event is the signal.
111 const moved = new Promise<void>((done) => {
112 const off = app.bus.subscribe((e) => { if (e.kind === "push" && e.repoId === fork.id) { off(); done(); } }, "local");
113 });
114 await commitToBranch(app, alice, lib, { message: "auto", files: [{ path: "auto.txt", content: "a\n" }] });
115 await moved;
116 expect(lastSyncOf(app.db, fork.id)!.changes).toBe(1);
117 }, 60_000);
test/tui-following.test.ts +6
@@ -36,6 +36,12 @@ describe("followingRows", () => {
3636 expect(rows[0]!.repo).toBe(parent);
3737 });
3838
39 test("the last sync's sentence is a row under the relation, and absent without one", () => {
40 const sentence = "Took 3 changes from alice/app on 2026-11-16.";
41 expect(followingRows(at("synced", 0, 0), undefined, undefined, sentence).map((r) => r.name)).toContain(` ${sentence}`);
42 expect(followingRows(at("synced", 0, 0), undefined)).toHaveLength(1);
43 });
44
3945 test("in step says so; a frozen parent never claims it", () => {
4046 expect(followingRows(at("synced", 0, 0), undefined)[0]!.words).toBe("in step");
4147 const frozen = { ...at("synced", 0, 0), parent: { ...parent, detached: { detachedAt: null } } } as ForkRelation;

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs