Skip to content

Commit 67547d2

Browse files
committed
Remove payload from task run task events
1 parent a50063c commit 67547d2

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

apps/webapp/app/v3/eventRepository.server.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,7 @@ export class EventRepository {
207207
}
208208

209209
async insertImmediate(event: CreatableEvent) {
210-
await this.db.taskEvent.create({
211-
data: event as Prisma.TaskEventCreateInput,
212-
});
213-
214-
this.#publishToRedis([event]);
210+
await this.#flushBatch([event]);
215211
}
216212

217213
async insertMany(events: CreatableEvent[]) {

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

-13
Original file line numberDiff line numberDiff line change
@@ -275,19 +275,6 @@ export class TriggerTaskService extends BaseService {
275275
},
276276
});
277277

278-
if (payloadPacket.data) {
279-
if (
280-
payloadPacket.dataType === "application/json" ||
281-
payloadPacket.dataType === "application/super+json"
282-
) {
283-
event.setAttribute("payload", JSON.parse(payloadPacket.data) as any);
284-
} else {
285-
event.setAttribute("payload", payloadPacket.data);
286-
}
287-
288-
event.setAttribute("payloadType", payloadPacket.dataType);
289-
}
290-
291278
event.setAttribute("runId", taskRun.friendlyId);
292279
span.setAttribute("runId", taskRun.friendlyId);
293280

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { task } from "@trigger.dev/sdk/v3";
2+
import { setTimeout } from "timers/promises";
3+
4+
export const nullByteCrash = task({
5+
id: "null-byte-parent",
6+
run: async (payload: any, { ctx }) => {
7+
const nullByteUnicode = "\u0000";
8+
9+
await setTimeout(5000);
10+
11+
await nullByteChild.triggerAndWait({
12+
message: `Null byte: ${nullByteUnicode}`,
13+
});
14+
},
15+
});
16+
17+
export const nullByteChild = task({
18+
id: "null-byte-child",
19+
run: async (payload: any, { ctx }) => {},
20+
});

0 commit comments

Comments
 (0)