Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): device tool update failures show the server error, not network advice #17569

MergedScottN-PV(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/17569/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 206 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
62 additions and 0 deletionsapps/server/src/device/DeviceService.test.tsModified
View file
@@ -888,3 +888,65 @@
Effect.provide(Layer.mergeAll(ServerSettings.layerTest(), NodeServices.layer)),
+​
+it.effect("a failed tool update reports npm's exit code but not its output", () =>
+ Effect.gen(function* () {
+ const host: DeviceHost.DeviceHost["Service"] = {
+ id: LOCAL_DEVICE_HOST_ID,
+ summary: Effect.succeed({
+ id: LOCAL_DEVICE_HOST_ID,
+ kind: "local",
+ label: "Test server",
+ platforms: [],
+ hubInstalled: false,
+ agentDeviceInstalled: false,
+ }),
+ platformAvailability: (platform) => Effect.succeed({ platform, available: false }),
+ ensureReady: () => Effect.die("Updating a tool does not start the hub"),
+ ensureAgentReady: () => Effect.die("Updating a tool does not start the agent"),
+ current: Effect.succeed(null),
+ stopAgent: Effect.void,
+ stop: Effect.void,
+ };
+ const npmFailure = {
+ code: ChildProcessSpawner.ExitCode(243),
+ stdout: "",
+ stderr: "npm error EACCES https://private:credential@registry.example.test/expo-device-hub",
+ timedOut: false,
+ stdoutTruncated: false,