Skip to content

Commit 37abc15

Browse files
committed
chore(updates): keep simulation tooling local
1 parent db712fd commit 37abc15

4 files changed

Lines changed: 13 additions & 1315 deletions

File tree

‎apps/server/src/updates/UpdateWindow.ts‎

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { ScheduledTaskId, ThreadId } from "@t3tools/contracts";
2-
import * as Config from "effect/Config";
32
import * as Context from "effect/Context";
43
import * as DateTime from "effect/DateTime";
54
import * as Duration from "effect/Duration";
@@ -17,24 +16,18 @@ import * as ServerSettings from "../serverSettings.ts";
1716
/** Work due this soon keeps the window closed, so it does not start late. */
1817
const UPDATE_LOOKAHEAD = Duration.minutes(5);
1918

20-
/**
21-
* Background update pacing. `T3CODE_UPDATE_LAB=1` (scripts/update-lab.ts)
22-
* shortens the waits so update flows can be exercised in seconds.
23-
*/
24-
export const updateTimings = Config.Boolean("T3CODE_UPDATE_LAB").pipe(
25-
Config.withDefault(false),
26-
Config.map((lab) => ({
27-
/**
28-
* How long every client must be untouched before an update may interrupt
29-
* it. Clients report activity about every 25s, so this must stay well above that.
30-
*/
31-
quietPeriod: lab ? Duration.seconds(60) : Duration.minutes(15),
32-
/** How often a waiting update rechecks the window or looks for new versions. */
33-
recheck: lab ? Duration.seconds(5) : Duration.seconds(30),
34-
firstPassDelay: lab ? Duration.seconds(10) : Duration.minutes(2),
35-
passInterval: lab ? Duration.seconds(20) : Duration.minutes(10),
36-
})),
37-
);
19+
/** Background update pacing. */
20+
export const updateTimings = Effect.succeed({
21+
/**
22+
* How long every client must be untouched before an update may interrupt
23+
* it. Clients report activity about every 25s, so this must stay well above that.
24+
*/
25+
quietPeriod: Duration.minutes(15),
26+
/** How often a waiting update rechecks the window or looks for new versions. */
27+
recheck: Duration.seconds(30),
28+
firstPassDelay: Duration.minutes(2),
29+
passInterval: Duration.minutes(10),
30+
});
3831

3932
export type UpdateWindowBlocker =
4033
| { readonly type: "active-threads"; readonly threadIds: ReadonlyArray<ThreadId> }

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"start:desktop": "vp run --filter @t3tools/desktop start",
1616
"start:marketing": "vp run --filter @t3tools/marketing preview",
1717
"start:mock-update-server": "node scripts/mock-update-server.ts",
18-
"update-lab": "node scripts/update-lab.ts",
1918
"screenshots:mobile": "node scripts/mobile-showcase.ts",
2019
"icons:export": "node scripts/export-brand-icons.ts",
2120
"icons:check": "node scripts/export-brand-icons.ts --check",

‎packages/provider-core/src/server/maintenanceResolver.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ export function createProviderVersionAdvisory(input: {
742742

743743
const DEFAULT_NPM_REGISTRY_URL = "https://registry.npmjs.org";
744744

745-
/** npm's own registry override, so mirrors (and local fake registries) answer "latest". */
745+
/** Respect npm's registry override when checking mirrors for newer provider versions. */
746746
const NpmRegistryUrlConfig = Config.String("npm_config_registry").pipe(
747747
Config.withDefault(DEFAULT_NPM_REGISTRY_URL),
748748
Config.map((url) => url.trim().replace(/\/+$/, "") || DEFAULT_NPM_REGISTRY_URL),

0 commit comments

Comments
 (0)