There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix: gql result check for clean history (#7154)
darkskygita5f9bfdda96a
diff --git a/packages/backend/server/src/plugins/copilot/resolver.ts b/packages/backend/server/src/plugins/copilot/resolver.tsindex 6f7cdc5041..3d45cfd4f8 100644--- a/packages/backend/server/src/plugins/copilot/resolver.ts+++ b/packages/backend/server/src/plugins/copilot/resolver.ts@@ -314,7 +314,7 @@ export class CopilotResolver {return session;}- @Mutation(() => String, {+ @Mutation(() => [String], {description: 'Cleanup sessions',})async cleanupCopilotSession(@@ -336,11 +336,10 @@ export class CopilotResolver {return new TooManyRequestsException('Server is busy');}- const ret = await this.chatSession.cleanup({+ return await this.chatSession.cleanup({...options,userId: user.id,});- return ret;}@Mutation(() => String, {diff --git a/packages/backend/server/src/plugins/copilot/session.ts b/packages/backend/server/src/plugins/copilot/session.tsindex 70722e2a2c..ba1d1fd0d8 100644--- a/packages/backend/server/src/plugins/copilot/session.ts+++ b/packages/backend/server/src/plugins/copilot/session.ts@@ -514,24 +514,24 @@ export class ChatSessionService {// only mark action session as deleted// chat session always can be reuse- {- const actionIds = (- await Promise.all(- sessions.map(({ id, promptName }) =>- this.prompt- .get(promptName)- .then(prompt => ({ id, action: !!prompt?.action }))- )+ const actionIds = (+ await Promise.all(+ sessions.map(({ id, promptName }) =>+ this.prompt+ .get(promptName)+ .then(prompt => ({ id, action: !!prompt?.action }))))- .filter(({ action }) => action)- .map(({ id }) => id);+ )+ .filter(({ action }) => action)+ .map(({ id }) => id);- await tx.aiSession.updateMany({- where: { id: { in: actionIds } },- data: { deletedAt: new Date() },- });- }+ await tx.aiSession.updateMany({+ where: { id: { in: actionIds } },+ data: { deletedAt: new Date() },+ });++ return [...sessionIds, ...actionIds];});}diff --git a/packages/backend/server/src/schema.gql b/packages/backend/server/src/schema.gqlindex 41667a30ec..9816f72cea 100644--- a/packages/backend/server/src/schema.gql+++ b/packages/backend/server/src/schema.gql@@ -254,7 +254,7 @@ type Mutation {changePassword(newPassword: String!, token: String!): UserType!"""Cleanup sessions"""- cleanupCopilotSession(options: DeleteSessionInput!): String!+ cleanupCopilotSession(options: DeleteSessionInput!): [String!]!"""Create a subscription checkout link of stripe"""createCheckoutSession(input: CreateCheckoutSessionInput!): String!