Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): project updates reach folded settings #22827

Closedjuliusmarmingewants to merge 4 commits intomain fromfix/issue-14991opened View on GitHub

Showing 8 changed files with 48 additions and 23 deletions (loading 5).

x
0 of 8 viewed, 8 left
11 additions and 8 deletionsapps/server/src/device/DeviceService.test.tsModified
View file
@@ -203,14 +203,17 @@
ready: Effect.void,
getSettings: Ref.get(settings),
updateSettings: (patch) =>
- Ref.updateAndGet(settings, (current) => ({
- ...current,
- enableDeviceSupport: patch.enableDeviceSupport ?? current.enableDeviceSupport,
- enableAgentDeviceAccess:
- patch.enableAgentDeviceAccess ?? current.enableAgentDeviceAccess,
- deviceOnboardingCompleted:
- patch.deviceOnboardingCompleted ?? current.deviceOnboardingCompleted,
- })),
+ Ref.updateAndGet(settings, (current) => {
+ const resolvedPatch = typeof patch === "function" ? patch(current) : patch;
+ return {
+ ...current,
+ enableDeviceSupport: resolvedPatch.enableDeviceSupport ?? current.enableDeviceSupport,
+ enableAgentDeviceAccess:
+ resolvedPatch.enableAgentDeviceAccess ?? current.enableAgentDeviceAccess,
+ deviceOnboardingCompleted:
+ resolvedPatch.deviceOnboardingCompleted ?? current.deviceOnboardingCompleted,
+ };
+ }),
streamChanges: Stream.empty,
subscribeChanges: Effect.succeed(Stream.empty),
}),
29 additions and 12 deletionsapps/server/src/orchestration-v2/EventSink.tsModified
View file