Remove payload from task run task events

This commit is contained in:
Eric Allam
2024-09-12 14:12:07 +01:00
parent a50063ce04
commit 67547d2521
3 changed files with 21 additions and 18 deletions
+1 -5
View File
@@ -207,11 +207,7 @@ export class EventRepository {
}
async insertImmediate(event: CreatableEvent) {
await this.db.taskEvent.create({
data: event as Prisma.TaskEventCreateInput,
});
this.#publishToRedis([event]);
await this.#flushBatch([event]);
}
async insertMany(events: CreatableEvent[]) {
@@ -275,19 +275,6 @@ export class TriggerTaskService extends BaseService {
},
});
if (payloadPacket.data) {
if (
payloadPacket.dataType === "application/json" ||
payloadPacket.dataType === "application/super+json"
) {
event.setAttribute("payload", JSON.parse(payloadPacket.data) as any);
} else {
event.setAttribute("payload", payloadPacket.data);
}
event.setAttribute("payloadType", payloadPacket.dataType);
}
event.setAttribute("runId", taskRun.friendlyId);
span.setAttribute("runId", taskRun.friendlyId);
@@ -0,0 +1,20 @@
import { task } from "@trigger.dev/sdk/v3";
import { setTimeout } from "timers/promises";
export const nullByteCrash = task({
id: "null-byte-parent",
run: async (payload: any, { ctx }) => {
const nullByteUnicode = "\u0000";
await setTimeout(5000);
await nullByteChild.triggerAndWait({
message: `Null byte: ${nullByteUnicode}`,
});
},
});
export const nullByteChild = task({
id: "null-byte-child",
run: async (payload: any, { ctx }) => {},
});