Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): background activity settings save without dropping the connection #18129

Closedbfowler(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/18129/headopened View on GitHub

Showing 3 changed files with 67 additions and 31 deletions.

x
0 of 3 viewed, 3 left
29 additions and 0 deletionsapps/server/src/auth/RpcAuthorization.test.tsModified
View file
@@ -20,6 +20,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 RpcTest from "effect/rpc/RpcTest";
@@ -323,6 +324,34 @@
}).pipe(Effect.scoped),
​
+ it.effect("authorizes settings 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: {
+ automaticGitFetchInterval: Duration.minutes(5),
+ backgroundActivity: {
+ profile: "custom",