Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): project updates on folded settings reach new threads #35452

Openjuliusmarmingewants to merge 4 commits intomain fromrefs/pull/35452/headopened View on GitHub

Showing 6 changed files with 79 additions and 13 deletions (loading 3).

x
0 of 6 viewed, 6 left
12 additions and 9 deletionsapps/server/src/device/DeviceService.test.tsModified
View file
@@ -313,15 +313,18 @@
start: Effect.void,
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,
- })),
+ updateSettings: (update) =>
+ Ref.updateAndGet(settings, (current) => {
+ const patch = ServerSettings.resolveServerSettingsPatch(current, update);
+ return {
+ ...current,
+ enableDeviceSupport: patch.enableDeviceSupport ?? current.enableDeviceSupport,
+ enableAgentDeviceAccess:
+ patch.enableAgentDeviceAccess ?? current.enableAgentDeviceAccess,
+ deviceOnboardingCompleted:
+ patch.deviceOnboardingCompleted ?? current.deviceOnboardingCompleted,
+ };
+ }),
streamChanges: Stream.empty,
subscribeChanges: Effect.succeed(Stream.empty),
}),