Skip to content

Commit f492427

Browse files
committed
fix(server): identify provider history database errors
1 parent 7ec7746 commit f492427

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎apps/server/src/serverSettings.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,23 @@ it.layer(NodeServices.layer)("server settings", (it) => {
118118
}).pipe(Effect.provide(settingsLayer));
119119
});
120120

121+
it.effect("identifies provider history query failures", () =>
122+
Effect.gen(function* () {
123+
const serverConfig = yield* ServerConfig.ServerConfig;
124+
const serverSettings = yield* ServerSettingsModule.ServerSettingsService;
125+
const sql = yield* SqlClient.SqlClient;
126+
yield* sql`DROP TABLE projection_thread_sessions`;
127+
128+
const error = yield* Effect.flip(serverSettings.getSettings);
129+
130+
assert.deepInclude(error, {
131+
_tag: "ServerSettingsError",
132+
operation: "read-provider-history",
133+
settingsPath: serverConfig.settingsPath,
134+
});
135+
}).pipe(Effect.provide(makeServerSettingsLayer())),
136+
);
137+
121138
it.effect("decodes nested settings patches", () =>
122139
Effect.gen(function* () {
123140
assert.deepEqual(

‎apps/server/src/serverSettings.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ const make = Effect.gen(function* () {
453453
(cause) =>
454454
new ServerSettingsError({
455455
settingsPath,
456-
operation: "read-file",
456+
operation: "read-provider-history",
457457
cause,
458458
}),
459459
),

‎packages/contracts/src/settings.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ export const ServerSettingsOperation = Schema.Literals([
736736
"normalize",
737737
"check-exists",
738738
"read-file",
739+
"read-provider-history",
739740
"read-secret",
740741
"remove-secret",
741742
"remove-stale-secret",

0 commit comments

Comments
 (0)