Get current user id via ALS in ChatSystemMessage

This commit is contained in:
Kalle
2026-06-21 13:54:24 +03:00
parent 9df09bf4d5
commit 9d6030d17d
10 changed files with 21 additions and 44 deletions

View File

@@ -1,6 +1,7 @@
import { add } from "date-fns";
import { nanoid } from "nanoid";
import { ServerConfig } from "~/config.server";
import { actorIdOrNullSafe } from "~/features/auth/core/user.server";
import * as UserRepository from "~/features/user-page/UserRepository.server";
import { IS_E2E_TEST_RUN } from "~/utils/e2e";
import invariant from "~/utils/invariant";
@@ -60,7 +61,7 @@ export const send: ChatSystemMessageService["send"] = (partialMsg) => {
context: partialMsg.context,
type: partialMsg.type,
revalidateOnly: partialMsg.revalidateOnly,
authorUserId: partialMsg.authorUserId,
authorUserId: partialMsg.authorUserId ?? actorIdOrNullSafe() ?? undefined,
};
});