Skip to content

Commit b17ef59

Browse files
committed
fix(webapp): accept all valid run and batch IDs in dashboard filters
The Run ID and Batch ID filter inputs on the runs list, batches list, and logs view hard-coded the exact friendly-id lengths. Run and batch IDs in the current format are two characters longer, so they were rejected with a "wrong length" error and the Apply button stayed disabled, making it impossible to filter by a recently created run or batch ID from the UI. These filters now validate IDs with the shared id-shape classifier instead of hard-coded lengths, so they accept every valid ID and will not drift if the format changes again. The waitpoint ID filter gets the same fix pre-emptively.
1 parent 70bca82 commit b17ef59

5 files changed

Lines changed: 16 additions & 6 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
The Run ID and Batch ID filters on the runs, batches, and logs pages now accept all valid run and batch IDs, fixing a case where recently created IDs were incorrectly rejected.

apps/webapp/app/components/logs/LogsRunIdFilter.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as Ariakit from "@ariakit/react";
22
import { FingerPrintIcon } from "@heroicons/react/20/solid";
3+
import { isClassifiable } from "@trigger.dev/core/v3/isomorphic";
34
import { useCallback, useState } from "react";
45
import { AppliedFilter } from "~/components/primitives/AppliedFilter";
56
import { Button } from "~/components/primitives/Buttons";
@@ -72,8 +73,8 @@ function RunIdDropdown({
7273
if (runId) {
7374
if (!runId.startsWith("run_")) {
7475
error = "Run IDs start with 'run_'";
75-
} else if (runId.length !== 25 && runId.length !== 29) {
76-
error = "Run IDs are 25 or 29 characters long";
76+
} else if (!isClassifiable(runId)) {
77+
error = "That doesn't look like a valid run ID";
7778
}
7879
}
7980

apps/webapp/app/components/runs/v3/BatchFilters.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as Ariakit from "@ariakit/react";
22
import { Squares2X2Icon, XMarkIcon } from "@heroicons/react/20/solid";
33
import { Form } from "@remix-run/react";
4+
import { isClassifiable } from "@trigger.dev/core/v3/isomorphic";
45
import type { BatchTaskRunStatus } from "@trigger.dev/database";
56
import { type ReactNode, useRef } from "react";
67
import { z } from "zod";
@@ -227,7 +228,7 @@ function PermanentStatusFilter() {
227228

228229
function validateBatchId(value: string): string | undefined {
229230
if (!value.startsWith("batch_")) return "Batch IDs start with 'batch_'";
230-
if (value.length !== 27 && value.length !== 31) return "Batch IDs are 27 or 31 characters long";
231+
if (!isClassifiable(value)) return "That doesn't look like a valid batch ID";
231232
}
232233

233234
function BatchIdDropdown(

apps/webapp/app/components/runs/v3/RunFilters.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import { Form, useFetcher } from "@remix-run/react";
1414
import { IconRotateClockwise2, IconToggleLeft } from "@tabler/icons-react";
1515
import { MachinePresetName } from "@trigger.dev/core/v3";
16+
import { isClassifiable } from "@trigger.dev/core/v3/isomorphic";
1617
import type { BulkActionType, TaskRunStatus, TaskTriggerSource } from "@trigger.dev/database";
1718
import { matchSorter } from "match-sorter";
1819
import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
@@ -1715,7 +1716,7 @@ function RootOnlyToggle({ defaultValue }: { defaultValue: boolean }) {
17151716

17161717
function validateRunId(value: string): string | undefined {
17171718
if (!value.startsWith("run_")) return "Run IDs start with 'run_'";
1718-
if (value.length !== 25 && value.length !== 29) return "Run IDs are 25 or 29 characters long";
1719+
if (!isClassifiable(value)) return "That doesn't look like a valid run ID";
17191720
}
17201721

17211722
function RunIdDropdown(
@@ -1770,7 +1771,7 @@ function AppliedRunIdFilter() {
17701771

17711772
function validateBatchId(value: string): string | undefined {
17721773
if (!value.startsWith("batch_")) return "Batch IDs start with 'batch_'";
1773-
if (value.length !== 27 && value.length !== 31) return "Batch IDs are 27 or 31 characters long";
1774+
if (!isClassifiable(value)) return "That doesn't look like a valid batch ID";
17741775
}
17751776

17761777
function BatchIdDropdown(

apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as Ariakit from "@ariakit/react";
22
import { FingerPrintIcon, TagIcon, XMarkIcon } from "@heroicons/react/20/solid";
33
import { Form, useFetcher } from "@remix-run/react";
44
import { WaitpointTokenStatus, waitpointTokenStatuses } from "@trigger.dev/core/v3";
5+
import { isClassifiable } from "@trigger.dev/core/v3/isomorphic";
56
import { ListChecks } from "lucide-react";
67
import { matchSorter } from "match-sorter";
78
import { type ReactNode, useEffect, useMemo, useRef } from "react";
@@ -409,7 +410,7 @@ function WaitpointIdDropdown(
409410
paramKey="id"
410411
validate={(v) => {
411412
if (!v.startsWith("waitpoint_")) return "Waitpoint IDs start with 'waitpoint_'";
412-
if (v.length !== 35) return "Waitpoint IDs are 35 characters long";
413+
if (!isClassifiable(v)) return "That doesn't look like a valid waitpoint ID";
413414
return undefined;
414415
}}
415416
/>

0 commit comments

Comments
 (0)