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
Merged 11h 43m ago, live in production
scout/forge:scout/18230-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 0 commits fork 1 thread · 1 unresolved
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 | ||
| 47 | 47 | ]; |
| 48 | 48 | ctx.invalidate(); |
| 49 | 49 | }; |
| 50 | void load(); | |
| 50 | // The first read, which a key pressed before it lands waits for rather than refusing. | |
| 51 | const first = load(); | |
| 51 | 52 | |
| 52 | 53 | const lines = (): string[] => { |
| 53 | 54 | if (mods === undefined) return ["Reading the lockfile…"]; |
| @@ -74,6 +75,7 @@ export function gameModsScreen(f: Session, ctx: Ctx, box: GameBox, service: stri | ||
| 74 | 75 | |
| 75 | 76 | /** Plan with `make` on the state as read; the preview replaces the list until `y` or `n`. */ |
| 76 | 77 | const preview = async (make: (m: Mods) => Promise<Result<Plan>>): Promise<string> => { |
| 78 | if (mods === undefined) await first; | |
| 77 | 79 | if (!mods?.ok) return mods?.error ?? "Reading the lockfile…"; |
| 78 | 80 | const got = await make(mods.value); |
| 79 | 81 | if (!got.ok) return got.error; |
test/game-mods.test.ts +19 −3
| @@ -862,7 +862,8 @@ describe("the survival performance set", () => { | ||
| 862 | 862 | const { app: tui, session } = createForgeApp(app, { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:test", user: alice }, { terminal, exitHooks: false }); |
| 863 | 863 | tui.start(); |
| 864 | 864 | 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:"); | |
| 866 | 867 | terminal.feed("s"); |
| 867 | 868 | await settleUntil(tui, "Adds Lithium 0.17.0"); |
| 868 | 869 | expect(tui.screen.toText()).toContain("y commits it"); |
| @@ -871,6 +872,21 @@ describe("the survival performance set", () => { | ||
| 871 | 872 | expect((await mods("smp")).lock.some((l) => l.slug === "lithium")).toBe(true); |
| 872 | 873 | tui.stop?.(); |
| 873 | 874 | }); |
| 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 | }); | |
| 874 | 890 | }); |
| 875 | 891 | |
| 876 | 892 | describe("the quality-of-life set (#18089)", () => { |
| @@ -1023,7 +1039,7 @@ describe("the quality-of-life set (#18089)", () => { | ||
| 1023 | 1039 | const { app: tui, session } = createForgeApp(app, { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:test", user: alice }, { terminal, exitHooks: false }); |
| 1024 | 1040 | tui.start(); |
| 1025 | 1041 | 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:"); | |
| 1027 | 1043 | terminal.feed("q"); |
| 1028 | 1044 | await settleUntil(tui, "Left out rightclickharvest"); |
| 1029 | 1045 | terminal.feed("y"); |
| @@ -1211,7 +1227,7 @@ describe("a slug the lock holds is not followed to another project (#18196)", () | ||
| 1211 | 1227 | const { app: tui, session } = createForgeApp(app, { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:test", user: alice }, { terminal, exitHooks: false }); |
| 1212 | 1228 | tui.start(); |
| 1213 | 1229 | 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:"); | |
| 1215 | 1231 | terminal.feed("q"); |
| 1216 | 1232 | await settleUntil(tui, "essential-commands is now project ECid0002 by mallory"); |
| 1217 | 1233 | tui.stop?.(); |
new above
offline
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.