Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): device_close shutdown no longer reports success after a restart forgot the device #25167

Closedisaacentebi(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/25167/headopened View on GitHub

Showing 4 changed files with 141 additions and 1 deletion (loading 3).

x
0 of 4 viewed, 4 left
141 additions and 1 deletionapps/server/src/device/DeviceService.test.tsModified
View file
@@ -52,7 +52,11 @@
| DeviceHost.AgentDeviceStartError,
inspectError = false,
installTool?: Parameters<typeof DeviceService.makeWithHosts>[3],
- options: { readonly endsDevices?: boolean; readonly routesStreams?: boolean } = {},
+ options: {
+ readonly endsDevices?: boolean;
+ readonly routesStreams?: boolean;
+ readonly onShutdown?: Effect.Effect<void>;
+ } = {},
) {
const settings = yield* Ref.make(DEFAULT_SERVER_SETTINGS);
const starts: string[] = [];
@@ -74,6 +78,7 @@
if (request.url.endsWith("/shutdown")) {
shutDown = true;
booted = false;
+ yield* options.onShutdown ?? Effect.void;
return HttpClientResponse.fromWeb(request, Response.json({ ok: true }));
if (shutDown && failListAfterShutdown) {
@@ -629,6 +634,141 @@
}).pipe(Effect.scoped),
​
+it.effect("a device no thread has open is not turned off under an open racing it", () =>
+ Effect.gen(function* () {
+ const started = yield* Deferred.make<void>();