Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): build native dependencies before activating updates #10687

Closedflamboh(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/10687/headopened View on GitHub

Showing 6 changed files with 117 additions and 1 deletion (loading 3).

x
0 of 6 viewed, 6 left
21 additions and 0 deletionsapps/server/src/cloud/bootService.test.tsModified
View file
@@ -211,6 +211,27 @@
});
​
it.layer(NodeServices.layer)("boot service install", (it) => {
+ it.effect("preserves the running service when a cached runtime cannot load node-pty", () =>
+ Effect.gen(function* () {
+ const { service, fs, statePath, commands, control, runtime } = yield* makeHarness();
+ const plan = yield* service.install();
+ const stateBefore = yield* fs.readFileString(statePath);
+ const unitBefore = yield* fs.readFileString(plan.unitPath);
+ control.failCommand = commands.find((command) => command.includes("--input-type=commonjs"));
+ expect(control.failCommand).toBeDefined();
+ commands.length = 0;
+​
+ const error = yield* service.install().pipe(Effect.flip);
+​
+ expect(error.message).toContain("loading node-pty");
+ expect(yield* fs.readFileString(statePath)).toBe(stateBefore);
+ expect(yield* fs.readFileString(plan.unitPath)).toBe(unitBefore);
+ expect(yield* fs.exists(runtime.sentinelPath)).toBe(true);
+ expect(commands).not.toContain("systemctl --user stop t3code.service");
+ expect(commands).not.toContain("systemctl --user restart t3code.service");
+ }),
+ );
+​
it.effect(
"fails before installing files or validating a runtime when lingering needs an administrator",
() =>