Skip to content

Commit f613c00

Browse files
committed
make it clear whats happening here
1 parent b115627 commit f613c00

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

apps/webapp/app/runEngine/services/triggerTask.server.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,15 @@ export class RunEngineTriggerTaskService {
379379
this.prisma
380380
);
381381

382-
// If the returned run has a different friendlyId, it was debounced
383-
// Stop the outer span to prevent a duplicate - the debounced span was created via onDebounced
384-
if (taskRun.friendlyId !== runFriendlyId) {
382+
// If the returned run has a different friendlyId, it was debounced.
383+
// For triggerAndWait: stop the outer span since a replacement debounced span was created via onDebounced.
384+
// For regular trigger: let the span complete normally - no replacement span needed since the
385+
// original run already has its span from when it was first created.
386+
if (
387+
taskRun.friendlyId !== runFriendlyId &&
388+
body.options?.debounce &&
389+
body.options?.resumeParentOnCompletion
390+
) {
385391
event.stop();
386392
}
387393

0 commit comments

Comments
 (0)