diff --git a/.changeset/three-olives-love.md b/.changeset/three-olives-love.md new file mode 100644 index 0000000000..a4363d4200 --- /dev/null +++ b/.changeset/three-olives-love.md @@ -0,0 +1,5 @@ +--- +"@trigger.dev/sdk": patch +--- + +Removed the inline-code accessory from the logs when calling trigger or batchTrigger from a run diff --git a/apps/webapp/app/components/primitives/Badge.tsx b/apps/webapp/app/components/primitives/Badge.tsx index e87771e4c0..26a4486bb5 100644 --- a/apps/webapp/app/components/primitives/Badge.tsx +++ b/apps/webapp/app/components/primitives/Badge.tsx @@ -6,6 +6,8 @@ const variants = { "grid place-items-center rounded-full px-2 h-5 tracking-wider text-xxs bg-charcoal-750 text-text-bright uppercase whitespace-nowrap", small: "grid place-items-center rounded-full px-[0.4rem] h-4 tracking-wider text-xxs bg-background-dimmed text-text-dimmed uppercase whitespace-nowrap", + "extra-small": + "grid place-items-center border border-charcoal-650 rounded-sm px-1 h-4 border-tracking-wider text-xxs bg-background-bright text-blue-500 whitespace-nowrap", outline: "grid place-items-center rounded-sm px-1.5 h-5 tracking-wider text-xxs border border-dimmed text-text-dimmed uppercase whitespace-nowrap", "outline-rounded": diff --git a/apps/webapp/app/components/primitives/Table.tsx b/apps/webapp/app/components/primitives/Table.tsx index 5f4f0d7e53..4bd801eb4a 100644 --- a/apps/webapp/app/components/primitives/Table.tsx +++ b/apps/webapp/app/components/primitives/Table.tsx @@ -22,7 +22,7 @@ export const Table = forwardRef( fullWidth && "w-full" )} > - +
{children}
@@ -40,7 +40,10 @@ export const TableHeader = forwardRef return ( {children} @@ -56,7 +59,10 @@ type TableBodyProps = { export const TableBody = forwardRef( ({ className, children }, ref) => { return ( - + {children} ); @@ -135,10 +141,17 @@ type TableCellProps = TableCellBasicProps & { hasAction?: boolean; isSticky?: boolean; actionClassName?: string; + rowHoverStyle?: keyof typeof rowHoverStyles; +}; + +const rowHoverStyles = { + default: "group-hover/table-row:bg-charcoal-800", + dimmed: "group-hover/table-row:bg-charcoal-850", + bright: "group-hover/table-row:bg-charcoal-750", }; const stickyStyles = - "sticky right-0 z-10 w-[2.8rem] min-w-[2.8rem] bg-background-dimmed before:absolute before:pointer-events-none before:-left-8 before:top-0 before:h-full before:min-w-[2rem] before:bg-gradient-to-r before:from-transparent before:to-background before:content-[''] group-hover/table-row:before:to-charcoal-900"; + "sticky right-0 z-10 w-[2.8rem] min-w-[2.8rem] bg-background-dimmed before:absolute before:pointer-events-none before:-left-8 before:top-0 before:h-full before:min-w-[2rem]"; export const TableCell = forwardRef( ( @@ -152,6 +165,7 @@ export const TableCell = forwardRef( onClick, hasAction = false, isSticky = false, + rowHoverStyle = "default", }, ref ) => { @@ -178,12 +192,11 @@ export const TableCell = forwardRef( + ); @@ -95,8 +97,12 @@ function ReplayForm({
submitForm(e)} className="pt-2"> {editablePayload ? ( <> + + Replaying will create a new run using the same or modified payload, executing against + the latest version in your selected environment. + Payload -
+
{ const env = environments.find((env) => env.id === value)!; return ( @@ -144,16 +150,20 @@ function ReplayForm({ - +
+ + + + +
); } diff --git a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx index cb8a7e5f02..002fa8c233 100644 --- a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx +++ b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx @@ -41,6 +41,7 @@ import { LiveTimer } from "./LiveTimer"; import { ReplayRunDialog } from "./ReplayRunDialog"; import { TaskRunStatusCombo } from "./TaskRunStatus"; import { RunTag } from "./RunTag"; +import { Badge } from "~/components/primitives/Badge"; type RunsTableProps = { total: number; @@ -123,7 +124,7 @@ export function TaskRunsTable({ )} Run # Env - Task ID + Task Version Status Started @@ -278,7 +279,12 @@ export function TaskRunsTable({ userName={run.environment.userName} /> - {run.taskIdentifier} + + + {run.taskIdentifier} + {run.rootTaskRunId === null ? Root : null} + + {run.version ?? "–"} diff --git a/apps/webapp/app/hooks/useReplaceLocation.ts b/apps/webapp/app/hooks/useReplaceLocation.ts deleted file mode 100644 index 0221ff8f5e..0000000000 --- a/apps/webapp/app/hooks/useReplaceLocation.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { useCallback, useState } from "react"; -import { useOptimisticLocation } from "./useOptimisticLocation"; -import type { Location } from "@remix-run/react"; - -export function useReplaceLocation() { - const optimisticLocation = useOptimisticLocation(); - const [location, setLocation] = useState(optimisticLocation); - - const replaceLocation = useCallback((location: Location) => { - const fullPath = location.pathname + location.search + location.hash; - //replace the URL in the browser - history.replaceState(null, "", fullPath); - //update the state (new object in case the same location ref was modified) - const newLocation = { ...location }; - setLocation(newLocation); - }, []); - - const replaceSearchParam = useCallback( - (key: string, value?: string) => { - const searchParams = new URLSearchParams(location.search); - if (value) { - searchParams.set(key, value); - } else { - searchParams.delete(key); - } - replaceLocation({ ...optimisticLocation, search: "?" + searchParams.toString() }); - }, - [optimisticLocation, replaceLocation] - ); - - return { location, replaceLocation, replaceSearchParam }; -} diff --git a/apps/webapp/app/hooks/useReplaceSearchParams.ts b/apps/webapp/app/hooks/useReplaceSearchParams.ts new file mode 100644 index 0000000000..b55c8bf217 --- /dev/null +++ b/apps/webapp/app/hooks/useReplaceSearchParams.ts @@ -0,0 +1,22 @@ +import { useSearchParams } from "@remix-run/react"; +import { useCallback } from "react"; + +export function useReplaceSearchParams() { + const [searchParams, setSearchParams] = useSearchParams(); + + const replaceSearchParam = useCallback( + (key: string, value?: string) => { + setSearchParams((s) => { + if (value) { + s.set(key, value); + } else { + s.delete(key); + } + return s; + }); + }, + [searchParams] + ); + + return { searchParams, setSearchParams, replaceSearchParam }; +} diff --git a/apps/webapp/app/presenters/v3/RunListPresenter.server.ts b/apps/webapp/app/presenters/v3/RunListPresenter.server.ts index cea8ca6231..ab73606e52 100644 --- a/apps/webapp/app/presenters/v3/RunListPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/RunListPresenter.server.ts @@ -168,6 +168,7 @@ export class RunListPresenter extends BasePresenter { usageDurationMs: BigInt; tags: string[]; depth: number; + rootTaskRunId: string | null; }[] >` SELECT @@ -192,6 +193,7 @@ export class RunListPresenter extends BasePresenter { tr."costInCents" AS "costInCents", tr."usageDurationMs" AS "usageDurationMs", tr."depth" AS "depth", + tr."rootTaskRunId" AS "rootTaskRunId", array_remove(array_agg(tag.name), NULL) AS "tags" FROM ${sqlDatabaseSchema}."TaskRun" tr @@ -336,6 +338,7 @@ WHERE usageDurationMs: Number(run.usageDurationMs), tags: run.tags.sort((a, b) => a.localeCompare(b)), depth: run.depth, + rootTaskRunId: run.rootTaskRunId, }; }), pagination: { diff --git a/apps/webapp/app/presenters/v3/RunPresenter.server.ts b/apps/webapp/app/presenters/v3/RunPresenter.server.ts index db67ed4c57..3ac7f73fda 100644 --- a/apps/webapp/app/presenters/v3/RunPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/RunPresenter.server.ts @@ -37,6 +37,13 @@ export class RunPresenter { status: true, completedAt: true, logsDeletedAt: true, + rootTaskRun: { + select: { + friendlyId: true, + taskIdentifier: true, + spanId: true, + }, + }, runtimeEnvironment: { select: { id: true, @@ -80,6 +87,7 @@ export class RunPresenter { isFinished: isFinalRunStatus(run.status), completedAt: run.completedAt, logsDeletedAt: run.logsDeletedAt, + rootTaskRun: run.rootTaskRun, environment: { id: run.runtimeEnvironment.id, organizationId: run.runtimeEnvironment.organizationId, @@ -141,6 +149,7 @@ export class RunPresenter { isFinished: isFinalRunStatus(run.status), completedAt: run.completedAt, logsDeletedAt: run.logsDeletedAt, + rootTaskRun: run.rootTaskRun, environment: { id: run.runtimeEnvironment.id, organizationId: run.runtimeEnvironment.organizationId, diff --git a/apps/webapp/app/presenters/v3/SpanPresenter.server.ts b/apps/webapp/app/presenters/v3/SpanPresenter.server.ts index 9b80f96d03..fd0c2ce4a5 100644 --- a/apps/webapp/app/presenters/v3/SpanPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/SpanPresenter.server.ts @@ -132,6 +132,21 @@ export class SpanPresenter extends BasePresenter { exportName: true, }, }, + //relationships + rootTaskRun: { + select: { + taskIdentifier: true, + friendlyId: true, + spanId: true, + }, + }, + parentTaskRun: { + select: { + taskIdentifier: true, + friendlyId: true, + spanId: true, + }, + }, }, where: { spanId, @@ -281,7 +296,15 @@ export class SpanPresenter extends BasePresenter { output, outputType: finishedAttempt?.outputType ?? "application/json", error, - links: span?.links, + relationships: { + root: run.rootTaskRun + ? { + ...run.rootTaskRun, + isParent: run.parentTaskRun?.friendlyId === run.rootTaskRun.friendlyId, + } + : undefined, + parent: run.parentTaskRun ?? undefined, + }, context: JSON.stringify(context, null, 2), metadata, }; @@ -307,10 +330,29 @@ export class SpanPresenter extends BasePresenter { return; } + const triggeredRuns = await this._replica.taskRun.findMany({ + select: { + friendlyId: true, + taskIdentifier: true, + spanId: true, + createdAt: true, + number: true, + lockedToVersion: { + select: { + version: true, + }, + }, + }, + where: { + parentSpanId: spanId, + }, + }); + return { ...span, events: span.events, properties: span.properties ? JSON.stringify(span.properties, null, 2) : undefined, + triggeredRuns, showActionBar: span.show?.actions === true, }; } diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx index 94bbe3cd85..39a4a49ec7 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx @@ -62,10 +62,10 @@ import { useEventSource } from "~/hooks/useEventSource"; import { useInitialDimensions } from "~/hooks/useInitialDimensions"; import { useOrganization } from "~/hooks/useOrganizations"; import { useProject } from "~/hooks/useProject"; -import { useReplaceLocation } from "~/hooks/useReplaceLocation"; +import { useReplaceSearchParams } from "~/hooks/useReplaceSearchParams"; import { Shortcut, useShortcutKeys } from "~/hooks/useShortcutKeys"; import { useUser } from "~/hooks/useUser"; -import { RunPresenter } from "~/presenters/v3/RunPresenter.server"; +import { Run, RunPresenter } from "~/presenters/v3/RunPresenter.server"; import { requireUserId } from "~/services/session.server"; import { cn } from "~/utils/cn"; import { lerp } from "~/utils/lerp"; @@ -142,11 +142,6 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => { type LoaderData = SerializeFrom; -function getSpanId(location: Location): string | undefined { - const search = new URLSearchParams(location.search); - return search.get("span") ?? undefined; -} - export default function Page() { const { run, trace, resizable, maximumLiveReloadingSetting } = useLoaderData(); const user = useUser(); @@ -202,7 +197,7 @@ export default function Page() { LeadingIcon={ArrowUturnLeftIcon} shortcut={{ key: "R" }} > - Replay run + Replay run… ; @@ -316,6 +311,7 @@ function TraceView({ run, trace, maximumLiveReloadingSetting, resizable }: Loade environmentType={run.environment.type} shouldLiveReload={shouldLiveReload} maximumLiveReloadingSetting={maximumLiveReloadingSetting} + rootRun={run.rootTaskRun} /> @@ -438,6 +434,11 @@ type TasksTreeViewProps = { environmentType: RuntimeEnvironmentType; shouldLiveReload: boolean; maximumLiveReloadingSetting: number; + rootRun: { + friendlyId: string; + taskIdentifier: string; + spanId: string; + } | null; }; function TasksTreeView({ @@ -451,6 +452,7 @@ function TasksTreeView({ environmentType, shouldLiveReload, maximumLiveReloadingSetting, + rootRun, }: TasksTreeViewProps) { const [filterText, setFilterText] = useState(""); const [errorsOnly, setErrorsOnly] = useState(false); @@ -517,8 +519,14 @@ function TasksTreeView({ >
- {parentRunFriendlyId ? ( - + {rootRun ? ( + + ) : parentRunFriendlyId ? ( + ) : ( This is the root task @@ -599,7 +607,7 @@ function TasksTreeView({ className="h-4 min-h-4 w-4 min-w-4" /> - {node.data.isRoot && Root} + {node.data.isRoot && !rootRun && Root}
@@ -645,7 +653,7 @@ function TasksTreeView({ /> -
+
; } -function ShowParentLink({ runFriendlyId }: { runFriendlyId: string }) { +function ShowParentLink({ + runFriendlyId, + spanId, + isRoot, +}: { + runFriendlyId: string; + spanId?: string; + isRoot: boolean; +}) { const [mouseOver, setMouseOver] = useState(false); const organization = useOrganization(); const project = useProject(); const { spanParam } = useParams(); + const span = spanId ? spanId : spanParam; + return ( - Show parent items + {isRoot ? "Show root run" : "Show parent run"} ); @@ -1141,7 +1159,7 @@ function ConnectedDevWarning() { isVisible ? "opacity-100" : "h-0 opacity-0" )} > - +
Runs usually start within 1 second in{" "} diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx index 3be620065f..25ae7d8378 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx @@ -64,7 +64,7 @@ import { useDebounce } from "~/hooks/useDebounce"; import { useInitialDimensions } from "~/hooks/useInitialDimensions"; import { useOrganization } from "~/hooks/useOrganizations"; import { useProject } from "~/hooks/useProject"; -import { useReplaceLocation } from "~/hooks/useReplaceLocation"; +import { useReplaceSearchParams } from "~/hooks/useReplaceSearchParams"; import { Shortcut, useShortcutKeys } from "~/hooks/useShortcutKeys"; import { useSyncRunPage } from "~/hooks/useSyncRunPage"; import { Trace, TraceEvent } from "~/hooks/useSyncTrace"; @@ -147,11 +147,6 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => { type LoaderData = UseDataFunctionReturn; -function getSpanId(location: Location): string | undefined { - const search = new URLSearchParams(location.search); - return search.get("span") ?? undefined; -} - export default function Page() { const { run, resizable } = useTypedLoaderData(); @@ -265,8 +260,8 @@ type InspectorState = | undefined; function Panels({ resizable, run: originalRun }: LoaderData) { - const { location, replaceSearchParam } = useReplaceLocation(); - const selectedSpanId = getSpanId(location); + const { searchParams, replaceSearchParam } = useReplaceSearchParams(); + const selectedSpanId = searchParams.get("span") ?? undefined; const appOrigin = useAppOrigin(); const { isUpToDate, events, runs } = useSyncRunPage({ @@ -1150,7 +1145,7 @@ function ConnectedDevWarning() { isVisible ? "opacity-100" : "h-0 opacity-0" )} > - +
Runs usually start within 2 seconds in{" "} diff --git a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route.tsx b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route.tsx index 552538f553..cb69864b54 100644 --- a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route.tsx +++ b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route.tsx @@ -19,6 +19,14 @@ import { Header2, Header3 } from "~/components/primitives/Headers"; import { Paragraph } from "~/components/primitives/Paragraph"; import * as Property from "~/components/primitives/PropertyTable"; import { Spinner } from "~/components/primitives/Spinner"; +import { + Table, + TableBody, + TableCell, + TableHeader, + TableHeaderCell, + TableRow, +} from "~/components/primitives/Table"; import { TabButton, TabContainer } from "~/components/primitives/Tabs"; import { TextLink } from "~/components/primitives/TextLink"; import { InfoIconTooltip, SimpleTooltip } from "~/components/primitives/Tooltip"; @@ -28,6 +36,7 @@ import { RunTag } from "~/components/runs/v3/RunTag"; import { SpanEvents } from "~/components/runs/v3/SpanEvents"; import { SpanTitle } from "~/components/runs/v3/SpanTitle"; import { TaskRunAttemptStatusCombo } from "~/components/runs/v3/TaskRunAttemptStatus"; +import { TaskRunsTable } from "~/components/runs/v3/TaskRunsTable"; import { TaskRunStatusCombo } from "~/components/runs/v3/TaskRunStatus"; import { useOrganization } from "~/hooks/useOrganizations"; import { useProject } from "~/hooks/useProject"; @@ -265,18 +274,6 @@ function SpanBody({ )} - {span.links && span.links.length > 0 && ( - - Links - -
- {span.links.map((link, index) => ( - - ))} -
-
-
- )}
) : ( @@ -318,21 +315,67 @@ function SpanBody({ Message {span.message} - {span.links && span.links.length > 0 && ( + {span.triggeredRuns.length > 0 && ( - Links - -
- {span.links.map((link, index) => ( - - ))} -
-
+
+ Triggered runs + + + + Run # + Task + Version + Created at + + + + {span.triggeredRuns.map((run) => { + const path = v3RunSpanPath( + organization, + project, + { friendlyId: run.friendlyId }, + { spanId: run.spanId } + ); + return ( + + + {run.number} + + + {run.taskIdentifier} + + + {run.lockedToVersion?.version ?? "–"} + + + + + + ); + })} + +
+
)} - - {span.events !== undefined && } + {span.events.length > 0 && } {span.properties !== undefined && ( + {run.relationships.root ? ( + run.relationships.root.isParent ? ( + + Root & Parent + + + {run.relationships.root.taskIdentifier} + + ({run.relationships.root.friendlyId}) + + + + + ) : ( + <> + + Root + + + {run.relationships.root.taskIdentifier} + + ({run.relationships.root.friendlyId}) + + + + + {run.relationships.parent ? ( + + Parent + + + {run.relationships.parent.taskIdentifier} + + ({run.relationships.parent.friendlyId}) + + + + + ) : null} + + ) + ) : null} Version @@ -562,18 +677,7 @@ function RunBody({ )} - {run.links && run.links.length > 0 && ( - - Links - -
- {run.links.map((link, index) => ( - - ))} -
-
-
- )} + Run invocation cost @@ -634,6 +738,7 @@ function RunBody({
+ {run.payload !== undefined && ( )} diff --git a/apps/webapp/app/routes/storybook.table/route.tsx b/apps/webapp/app/routes/storybook.table/route.tsx new file mode 100644 index 0000000000..2a509e5551 --- /dev/null +++ b/apps/webapp/app/routes/storybook.table/route.tsx @@ -0,0 +1,65 @@ +import React from "react"; +import { Header1, Header2 } from "~/components/primitives/Headers"; +import { Paragraph } from "~/components/primitives/Paragraph"; +import { + Table, + TableBody, + TableCell, + TableHeader, + TableHeaderCell, + TableRow, +} from "~/components/primitives/Table"; + +export default function Story() { + return ( +
+
+ Static table + This table scrolls with its parent container only. + + + + + Col 1 + Col 2 + Col 3 + + + + {Array.from({ length: 10 }, (_, index) => ( + + {index + 1} + {index + 2} + {index + 3} + + ))} + +
+
+
+ Sticky header table + + This table scrolls when a max-height is applied to the Table component. + + + + + Col 1 + Col 2 + Col 3 + + + + {Array.from({ length: 10 }, (_, index) => ( + + {index + 1} + {index + 2} + {index + 3} + + ))} + +
+
+
+ ); +} diff --git a/apps/webapp/app/routes/storybook/route.tsx b/apps/webapp/app/routes/storybook/route.tsx index b6ac587fff..7449597481 100644 --- a/apps/webapp/app/routes/storybook/route.tsx +++ b/apps/webapp/app/routes/storybook/route.tsx @@ -88,6 +88,10 @@ const stories: Story[] = [ name: "Switch", slug: "switch", }, + { + name: "Tables", + slug: "table", + }, { name: "Tabs", slug: "tabs", diff --git a/packages/database/prisma/migrations/20240926110455_add_parent_span_id_index_to_the_task_run_table/migration.sql b/packages/database/prisma/migrations/20240926110455_add_parent_span_id_index_to_the_task_run_table/migration.sql new file mode 100644 index 0000000000..da39a8092b --- /dev/null +++ b/packages/database/prisma/migrations/20240926110455_add_parent_span_id_index_to_the_task_run_table/migration.sql @@ -0,0 +1,2 @@ +-- CreateIndex +CREATE INDEX CONCURRENTLY IF NOT EXISTS "TaskRun_parentSpanId_idx" ON "TaskRun"("parentSpanId"); diff --git a/packages/database/prisma/schema.prisma b/packages/database/prisma/schema.prisma index c984e051d5..6b25eb5712 100644 --- a/packages/database/prisma/schema.prisma +++ b/packages/database/prisma/schema.prisma @@ -1782,6 +1782,7 @@ model TaskRun { @@index([scheduleId]) // Run page inspector @@index([spanId]) + @@index([parentSpanId]) // Finding completed runs @@index([completedAt]) } diff --git a/packages/trigger-sdk/src/v3/shared.ts b/packages/trigger-sdk/src/v3/shared.ts index e0d9fb208f..3d5ea3059b 100644 --- a/packages/trigger-sdk/src/v3/shared.ts +++ b/packages/trigger-sdk/src/v3/shared.ts @@ -808,15 +808,6 @@ async function trigger_internal( [SEMATTRS_MESSAGING_OPERATION]: "publish", ["messaging.client_id"]: taskContext.worker?.id, [SEMATTRS_MESSAGING_SYSTEM]: "trigger.dev", - ...accessoryAttributes({ - items: [ - { - text: id, - variant: "normal", - }, - ], - style: "codepath", - }), }, onResponseBody: (body, span) => { body && @@ -877,15 +868,6 @@ async function batchTrigger_internal( [SEMATTRS_MESSAGING_OPERATION]: "publish", ["messaging.client_id"]: taskContext.worker?.id, [SEMATTRS_MESSAGING_SYSTEM]: "trigger.dev", - ...accessoryAttributes({ - items: [ - { - text: id, - variant: "normal", - }, - ], - style: "codepath", - }), }, ...requestOptions, } diff --git a/references/v3-catalog/src/trigger/email.tsx b/references/v3-catalog/src/trigger/email.tsx index 2ffb9f863f..113bd97fcd 100644 --- a/references/v3-catalog/src/trigger/email.tsx +++ b/references/v3-catalog/src/trigger/email.tsx @@ -1,7 +1,6 @@ import { logger, task } from "@trigger.dev/sdk/v3"; import { ExampleEmail } from "./emails/index.js"; import { render } from "@react-email/render"; -import EmailReplyParser from "email-reply-parser"; export const emailTask = task({ id: "email", @@ -12,15 +11,3 @@ export const emailTask = task({ }; }, }); - -export const parseEmailReplyTask = task({ - id: "parse-email-reply", - run: async ({ email }: { email: string }) => { - const parsed = new EmailReplyParser().read(email); - - logger.log("Parsed email", { - email, - parsed, - }); - }, -}); diff --git a/references/v3-catalog/src/trigger/taskHierarchy.ts b/references/v3-catalog/src/trigger/taskHierarchy.ts index 9cda1c9232..f35af93601 100644 --- a/references/v3-catalog/src/trigger/taskHierarchy.ts +++ b/references/v3-catalog/src/trigger/taskHierarchy.ts @@ -17,7 +17,10 @@ export const rootTask = task({ } } else { if (useBatch) { - await childTask.batchTrigger([{ payload: { useWaits, useBatch } }]); + await childTask.batchTrigger([ + { payload: { useWaits, useBatch } }, + { payload: { useWaits, useBatch } }, + ]); } else { await childTask.trigger({ useWaits, useBatch }); }