Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): save advanced background activity settings #23342

Closedjuliusmarmingewants to merge 3 commits intomain fromfix/issue-17233opened View on GitHub

Showing 2 changed files with 33 additions and 1 deletion.

x
0 of 2 viewed, 2 left
29 additions and 0 deletionsapps/server/src/auth/RpcAuthorization.test.tsModified
View file
@@ -16,6 +16,7 @@
WsRpcGroup,
} from "@t3tools/contracts";
import { describe, expect, it } from "@effect/vitest";
+import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
@@ -171,6 +172,34 @@
}).pipe(Effect.scoped),
​
+ // The RPC server hands middleware the decoded payload, so durations arrive as Duration values.
+ it.effect("authorizes background activity overrides with decoded duration intervals", () =>
+ Effect.gen(function* () {
+ const client = yield* RpcTest.makeClient(group).pipe(
+ Effect.provide(
+ Layer.mergeAll(
+ group.toLayerHandler(WS_METHODS.serverUpdateSettings, () =>
+ Effect.succeed(DEFAULT_SERVER_SETTINGS),
+ ),
+ RpcAuthorization.layer([AuthSettingsWriteScope]),
+ ),
+ ),
+ );
+ const settings = yield* client[WS_METHODS.serverUpdateSettings]({
+ patch: {
+ backgroundActivity: {
+ profile: "custom",