fix: ensure job id is a clean string

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-12-08 20:32:29 +01:00
parent 4e42689115
commit 969c0bc8fe
4 changed files with 27 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ import { getSalts } from '@openpanel/db';
import { getEventsGroupQueueShard } from '@openpanel/queue';
import type { PostEventPayload } from '@openpanel/sdk';
import { generateId } from '@openpanel/common';
import { generateId, slug } from '@openpanel/common';
import { getGeoLocation } from '@openpanel/geo';
import { getStringHeaders, getTimestamp } from './track.controller';
@@ -54,7 +54,7 @@ export async function postEvent(
: `${projectId}:${generateId()}`
: currentDeviceId;
const jobId = [
request.body.name,
slug(request.body.name),
timestamp,
projectId,
currentDeviceId,