Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(server): normalize provider settings before use #10121

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromt3code/debt-gzuf-8-compatibilityopened View on GitHub

Showing 24 changed files with 8 additions and 19 deletions (loading 21).

x
0 of 24 viewed, 24 left
7 additions and 5 deletionsapps/server/src/orchestration/ThreadSettlementReactor.test.tsModified
View file
@@ -31,7 +31,7 @@
type PullRequestMergeEvent,
} from "../pullRequest/PullRequestService.ts";
import { ServerActivation } from "../serverActivation.ts";
-import { ServerSettingsService } from "../serverSettings.ts";
+import { resolveServerSettings, ServerSettingsService } from "../serverSettings.ts";
import { OrchestrationCommandInvariantError } from "./Errors.ts";
import {
OrchestrationEngineService,
@@ -206,11 +206,13 @@
const serverSettings = ServerSettingsService.of({
start: Effect.void,
ready: Effect.void,
- getSettings: Ref.get(settings),
- updateSettings,
- streamChanges: Stream.fromPubSub(settingsChanges),
+ getSettings: Ref.get(settings).pipe(Effect.map(resolveServerSettings)),
+ updateSettings: (patch) => updateSettings(patch).pipe(Effect.map(resolveServerSettings)),
+ streamChanges: Stream.fromPubSub(settingsChanges).pipe(Stream.map(resolveServerSettings)),
subscribeChanges: PubSub.subscribe(settingsChanges).pipe(
- Effect.map((subscription) => Stream.fromSubscription(subscription)),
+ Effect.map((subscription) =>
+ Stream.fromSubscription(subscription).pipe(Stream.map(resolveServerSettings)),
+ ),
});
​