fix: always use currentDeviceId on client request to make sure they arrive in same group

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-08 07:46:50 +02:00
parent 174a30d515
commit 5b2f09f29c
2 changed files with 11 additions and 10 deletions

View File

@@ -64,11 +64,11 @@ export async function postEvent(
const isGroupQueue = await getRedisCache().exists('group_queue');
if (isGroupQueue) {
const uaInfo = parseUserAgent(ua, request.body?.properties);
const groupId = request.body?.profileId
? `${projectId}:${request.body?.profileId}`
: uaInfo.isServer
? `${projectId}:${generateId()}`
: currentDeviceId;
const groupId = uaInfo.isServer
? request.body?.profileId
? `${projectId}:${request.body?.profileId}`
: `${projectId}:${generateId()}`
: currentDeviceId;
await eventsGroupQueue.add({
orderMs: new Date(timestamp).getTime(),
data: {