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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:f4rzrnk9yv is past its budget: trevato/forge: "the survival performance set > the terminal shows the set as the page does, and s previews it" failed o… #18236

opened this

Merged 11h 43m ago, live in production

scout/forge:scout/18230-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 0 commits fork 1 thread · 1 unresolved

  • Merged. scout/18230-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 6bd5128.

Review

Sign in to review this change.
2 files changed +22 −4
src/tui/screens/game_mods.ts +3 −1
@@ -47,7 +47,8 @@ export function gameModsScreen(f: Session, ctx: Ctx, box: GameBox, service: stri
4747 ];
4848 ctx.invalidate();
4949 };
50 void load();
50 // The first read, which a key pressed before it lands waits for rather than refusing.
51 const first = load();
5152
5253 const lines = (): string[] => {
5354 if (mods === undefined) return ["Reading the lockfile…"];
@@ -74,6 +75,7 @@ export function gameModsScreen(f: Session, ctx: Ctx, box: GameBox, service: stri
7475
7576 /** Plan with `make` on the state as read; the preview replaces the list until `y` or `n`. */
7677 const preview = async (make: (m: Mods) => Promise<Result<Plan>>): Promise<string> => {
78 if (mods === undefined) await first;

This waits for the whole load(), including the network update checks. Wait on the lockfile read alone, and make / (line ~118) wait the same way.

7779 if (!mods?.ok) return mods?.error ?? "Reading the lockfile…";
7880 const got = await make(mods.value);
7981 if (!got.ok) return got.error;
test/game-mods.test.ts +19 −3
@@ -862,7 +862,8 @@ describe("the survival performance set", () => {
862862 const { app: tui, session } = createForgeApp(app, { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:test", user: alice }, { terminal, exitHooks: false });
863863 tui.start();
864864 tui.ctx.push(gameModsScreen(session, tui.ctx, box, "smp"));
865 await settleUntil(tui, "Survival performance set");
865 // The body's line, not the key hint in the footer, which is drawn before the lockfile is read.
866 await settleUntil(tui, "Survival performance set:");
866867 terminal.feed("s");
867868 await settleUntil(tui, "Adds Lithium 0.17.0");
868869 expect(tui.screen.toText()).toContain("y commits it");
@@ -871,6 +872,21 @@ describe("the survival performance set", () => {
871872 expect((await mods("smp")).lock.some((l) => l.slug === "lithium")).toBe(true);
872873 tui.stop?.();
873874 });
875
876 test("s pressed before the lockfile is read waits for it and previews the set (#18230)", async () => {
877 const removed = await planRemove(await mods("smp"), "smp", "lithium");
878 if (!removed.ok) throw new Error(removed.error);
879 await commitPlan(app, alice, box, "smp", await mods("smp"), removed.value);
880 const terminal = headlessTerminal(160, 30);
881 const { app: tui, session } = createForgeApp(app, { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:test", user: alice }, { terminal, exitHooks: false });
882 tui.start();
883 tui.ctx.push(gameModsScreen(session, tui.ctx, box, "smp"));
884 terminal.feed("s");
885 await settleUntil(tui, "Adds Lithium 0.17.0");
886 expect(tui.screen.toText()).not.toContain("Reading the lockfile");
887 terminal.feed("n");
888 tui.stop?.();
889 });
874890 });
875891
876892 describe("the quality-of-life set (#18089)", () => {
@@ -1023,7 +1039,7 @@ describe("the quality-of-life set (#18089)", () => {
10231039 const { app: tui, session } = createForgeApp(app, { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:test", user: alice }, { terminal, exitHooks: false });
10241040 tui.start();
10251041 tui.ctx.push(gameModsScreen(session, tui.ctx, box, "smp"));
1026 await settleUntil(tui, "Quality of life set");
1042 await settleUntil(tui, "Quality of life set:");
10271043 terminal.feed("q");
10281044 await settleUntil(tui, "Left out rightclickharvest");
10291045 terminal.feed("y");
@@ -1211,7 +1227,7 @@ describe("a slug the lock holds is not followed to another project (#18196)", ()
12111227 const { app: tui, session } = createForgeApp(app, { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:test", user: alice }, { terminal, exitHooks: false });
12121228 tui.start();
12131229 tui.ctx.push(gameModsScreen(session, tui.ctx, box, "smp"));
1214 await settleUntil(tui, "Quality of life set");
1230 await settleUntil(tui, "Quality of life set:");
12151231 terminal.feed("q");
12161232 await settleUntil(tui, "essential-commands is now project ECid0002 by mallory");
12171233 tui.stop?.();

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs