From dbf92f8e2effb904d8dc5457d69dc002f38a014b Mon Sep 17 00:00:00 2001 From: zk Date: Sun, 17 May 2026 19:38:29 +0000 Subject: [PATCH] fix: i agree with nairobi --- Justfile-test | 2 +- .../dashboard/proposals/MyProposalsPage.tsx | 6 ++- .../seeds-webui/src/pages/QuestProposalPR.tsx | 8 +--- .../src/lib/jobs/cron/cron-service.test.ts | 40 +++++++++++++++---- .../server/src/lib/jobs/cron/cron-service.ts | 4 +- 5 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Justfile-test b/Justfile-test index ce3276cc2..4f125a2ac 100644 --- a/Justfile-test +++ b/Justfile-test @@ -21,7 +21,7 @@ fix: set -euo pipefail just gen - bun run --elide-lines=0 --filter '*' lint-fix + bun run --elide-lines=0 --filter '*' lint-fix -- --quiet .scripts/ts_autoinherit.js just fmt diff --git a/typescript/client/src/app/pages/dashboard/proposals/MyProposalsPage.tsx b/typescript/client/src/app/pages/dashboard/proposals/MyProposalsPage.tsx index 609401ef2..88168b24e 100644 --- a/typescript/client/src/app/pages/dashboard/proposals/MyProposalsPage.tsx +++ b/typescript/client/src/app/pages/dashboard/proposals/MyProposalsPage.tsx @@ -3,7 +3,7 @@ * with edit and withdraw capabilities. */ -import type { UnsuccessfulAPIResponse } from "tachi-common"; +import type { UnsuccessfulAPIResponse, UserDocument } from "tachi-common"; import useSetSubheader from "#components/layout/header/useSetSubheader"; import LoadingWrapper from "#components/util/LoadingWrapper"; @@ -51,6 +51,10 @@ export default function MyProposalsPage() { return ; } + return ; +} + +function MyProposalsPageInner({ user: _user }: { user: UserDocument }) { const [data, setData] = useState(null); const [error, setError] = useState(null); diff --git a/typescript/seeds-webui/src/pages/QuestProposalPR.tsx b/typescript/seeds-webui/src/pages/QuestProposalPR.tsx index 475919d47..77f1b55dc 100644 --- a/typescript/seeds-webui/src/pages/QuestProposalPR.tsx +++ b/typescript/seeds-webui/src/pages/QuestProposalPR.tsx @@ -7,13 +7,7 @@ * updated compared to the base branch. */ -import { - GITHUB_PAT_KEY, - SEEDS_DEFAULT_BRANCH, - SEEDS_GITHUB_HTML_URL, - SEEDS_REPO, - SEEDS_REPO_PATH, -} from "#lib/config"; +import { GITHUB_PAT_KEY, SEEDS_GITHUB_HTML_URL, SEEDS_REPO } from "#lib/config"; import { getTransport } from "#lib/transport/transport"; import { useMemo } from "react"; import { useQuery } from "react-query"; diff --git a/typescript/server/src/lib/jobs/cron/cron-service.test.ts b/typescript/server/src/lib/jobs/cron/cron-service.test.ts index fc3dcc960..6a43bce15 100644 --- a/typescript/server/src/lib/jobs/cron/cron-service.test.ts +++ b/typescript/server/src/lib/jobs/cron/cron-service.test.ts @@ -42,12 +42,33 @@ describe("getDueFireTime", () => { }); it("null last: daily monthly and yearly examples match a bounded forward reference", () => { - const specs: Array<{ schedule: string; now: string; maxSteps: number; daysBack: number }> = [ - { schedule: "5 0 * * *", now: "2026-05-17T18:45:30.000Z", maxSteps: 50, daysBack: 3 }, - { schedule: "0 0 * * *", now: "2026-05-17T18:45:30.000Z", maxSteps: 10, daysBack: 3 }, - { schedule: "0 0 1 * *", now: "2026-03-15T12:00:00.000Z", maxSteps: 40, daysBack: 60 }, - { schedule: "0 0 1 1 *", now: "2026-06-15T12:00:00.000Z", maxSteps: 10, daysBack: 400 }, - ]; + const specs: Array<{ daysBack: number; maxSteps: number; now: string; schedule: string }> = + [ + { + schedule: "5 0 * * *", + now: "2026-05-17T18:45:30.000Z", + maxSteps: 50, + daysBack: 3, + }, + { + schedule: "0 0 * * *", + now: "2026-05-17T18:45:30.000Z", + maxSteps: 10, + daysBack: 3, + }, + { + schedule: "0 0 1 * *", + now: "2026-03-15T12:00:00.000Z", + maxSteps: 40, + daysBack: 60, + }, + { + schedule: "0 0 1 1 *", + now: "2026-06-15T12:00:00.000Z", + maxSteps: 10, + daysBack: 400, + }, + ]; for (const { schedule, now: nowIso, maxSteps, daysBack } of specs) { const now = new Date(nowIso); const start = new Date(now.getTime() - daysBack * 24 * 60 * 60 * 1000); @@ -59,7 +80,12 @@ describe("getDueFireTime", () => { it("non-null last: unchanged skip-missed semantics vs forward reference", () => { const now = new Date("2026-05-17T18:45:30.000Z"); const last = new Date("2026-05-17T18:40:00.000Z"); - const expected = dueFireTimeForwardFrom("* * * * *", new Date(last.getTime() + 1), now, 200); + const expected = dueFireTimeForwardFrom( + "* * * * *", + new Date(last.getTime() + 1), + now, + 200, + ); expect(getDueFireTime("* * * * *", last, now)).toEqual(expected); }); diff --git a/typescript/server/src/lib/jobs/cron/cron-service.ts b/typescript/server/src/lib/jobs/cron/cron-service.ts index 7b5da18b4..dbfff968e 100644 --- a/typescript/server/src/lib/jobs/cron/cron-service.ts +++ b/typescript/server/src/lib/jobs/cron/cron-service.ts @@ -17,7 +17,9 @@ const CRON_ADVISORY_KEY2 = 0x63_72_6f_6e; // "cron" * `next()` is still <= `now`, then advance with the same `next()` loop as the non-null path. */ export function getDueFireTime(schedule: string, last: Date | null, now: Date): Date | null { - const startAndFirstAfter = (start: Date): { it: ReturnType; first: Date } => { + const startAndFirstAfter = ( + start: Date, + ): { first: Date; it: ReturnType } => { const it = CronExpressionParser.parse(schedule, { currentDate: start }); const first = it.next().toDate(); return { it, first };