diff --git a/src/database/server/models/user.ts b/src/database/server/models/user.ts index ef2a190c87f6..e4341d9c5a90 100644 --- a/src/database/server/models/user.ts +++ b/src/database/server/models/user.ts @@ -19,6 +19,12 @@ export class UserNotFoundError extends TRPCError { export class UserModel { static createUser = async (params: NewUser) => { + // if user already exists, skip creation + if (params.id) { + const user = await serverDB.query.users.findFirst({ where: eq(users.id, params.id) }); + if (!!user) return; + } + const [user] = await serverDB .insert(users) .values({ ...params }) diff --git a/src/libs/langchain/loaders/index.ts b/src/libs/langchain/loaders/index.ts index df9884d2038f..205b2dfc9004 100644 --- a/src/libs/langchain/loaders/index.ts +++ b/src/libs/langchain/loaders/index.ts @@ -61,7 +61,7 @@ export class ChunkingLoader { default: { throw new Error( - 'Unsupported file type, please check your file is a supported type, or just create an issue.', + `Unsupported file type [${type}], please check your file is supported, or create report issue here: https://github.com/lobehub/lobe-chat/discussions/3550`, ); } }