From 0f9d858efb8564d54704d54fd30144d88d0de9df Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 2 Jun 2026 16:09:19 +0000 Subject: [PATCH] Unwrap secret store options at call sites Co-authored-by: Julius Marminge --- apps/server/src/auth/Layers/ServerSecretStore.test.ts | 5 +++-- apps/server/src/serverSettings.ts | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/server/src/auth/Layers/ServerSecretStore.test.ts b/apps/server/src/auth/Layers/ServerSecretStore.test.ts index 120b0abd29..0bb41db184 100644 --- a/apps/server/src/auth/Layers/ServerSecretStore.test.ts +++ b/apps/server/src/auth/Layers/ServerSecretStore.test.ts @@ -208,8 +208,9 @@ it.layer(NodeServices.layer)("ServerSecretStoreLive", (it) => { const persisted = yield* secretStore.get("session-signing-key"); assert.isTrue(Option.isSome(persisted)); - assert.deepEqual(Array.from(first), Array.from(persisted.value)); - assert.deepEqual(Array.from(second), Array.from(persisted.value)); + const persistedBytes = Option.getOrThrow(persisted); + assert.deepEqual(Array.from(first), Array.from(persistedBytes)); + assert.deepEqual(Array.from(second), Array.from(persistedBytes)); }).pipe(Effect.provide(makeConcurrentCreateSecretStoreLayer())), ); diff --git a/apps/server/src/serverSettings.ts b/apps/server/src/serverSettings.ts index 5ea2e03813..62737c4238 100644 --- a/apps/server/src/serverSettings.ts +++ b/apps/server/src/serverSettings.ts @@ -31,6 +31,7 @@ import * as Effect from "effect/Effect"; import * as Exit from "effect/Exit"; import * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; +import * as Option from "effect/Option"; import * as Path from "effect/Path"; import * as Equal from "effect/Equal"; import * as PubSub from "effect/PubSub"; @@ -349,7 +350,10 @@ const makeServerSettings = Effect.gen(function* () { ); environment.push({ ...variable, - value: secret ? textDecoder.decode(secret) : "", + value: Option.match(secret, { + onSome: (bytes) => textDecoder.decode(bytes), + onNone: () => "", + }), }); } providerInstances[instanceId] = {