From 6385794603709684d0048ef6da6416e99d2e8bbe Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Thu, 13 Jun 2024 14:50:51 +0800 Subject: [PATCH] fix: system plugin run time error (#1754) --- .../content/zh-cn/docs/development/upgrading/484.md | 11 ++++++----- packages/service/core/plugin/controller.ts | 3 ++- packages/service/core/workflow/dispatch/index.ts | 2 -- .../service/core/workflow/dispatch/tools/http468.ts | 1 - packages/service/package.json | 2 ++ pnpm-lock.yaml | 6 ++++++ 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docSite/content/zh-cn/docs/development/upgrading/484.md b/docSite/content/zh-cn/docs/development/upgrading/484.md index 0804968619b..7db9f8f510f 100644 --- a/docSite/content/zh-cn/docs/development/upgrading/484.md +++ b/docSite/content/zh-cn/docs/development/upgrading/484.md @@ -30,8 +30,9 @@ curl --location --request POST 'https://{{host}}/api/admin/init/484' \ 1. 新增 - 应用使用新权限系统。 2. 新增 - 应用支持文件夹。 3. 优化 - 文本分割增加连续换行、制表符清除,避免大文本性能问题。 -4. 修复 - Debug 模式下,相同 source 和 target 内容,导致连线显示异常。 -5. 修复 - 定时执行初始化错误。 -6. 修复 - 应用调用传参异常。 -7. 修复 - ctrl + cv 复杂节点时,nodeId错误。 -8. 调整组件库全局theme。 \ No newline at end of file +4. 重要修复 - 修复系统插件运行池数据污染问题,由于从内存获取,会导致全局污染。 +5. 修复 - Debug 模式下,相同 source 和 target 内容,导致连线显示异常。 +6. 修复 - 定时执行初始化错误。 +7. 修复 - 应用调用传参异常。 +8. 修复 - ctrl + cv 复杂节点时,nodeId错误。 +9. 调整组件库全局theme。 \ No newline at end of file diff --git a/packages/service/core/plugin/controller.ts b/packages/service/core/plugin/controller.ts index fb31b3916f1..787cfee5c1d 100644 --- a/packages/service/core/plugin/controller.ts +++ b/packages/service/core/plugin/controller.ts @@ -7,6 +7,7 @@ import type { PluginRuntimeType, PluginTemplateType } from '@fastgpt/global/core import { FlowNodeTemplateTypeEnum } from '@fastgpt/global/core/workflow/constants'; import { getHandleConfig } from '../../../global/core/workflow/template/utils'; import { getNanoid } from '@fastgpt/global/common/string/tools'; +import { cloneDeep } from 'lodash'; /* plugin id rule: @@ -36,7 +37,7 @@ const getPluginTemplateById = async (id: string): Promise => const item = global.communityPlugins?.find((plugin) => plugin.id === pluginId); if (!item) return Promise.reject('plugin not found'); - return item; + return cloneDeep(item); } if (source === PluginSourceEnum.personal) { const item = await MongoPlugin.findById(id).lean(); diff --git a/packages/service/core/workflow/dispatch/index.ts b/packages/service/core/workflow/dispatch/index.ts index e3f82236f54..a38c44985e1 100644 --- a/packages/service/core/workflow/dispatch/index.ts +++ b/packages/service/core/workflow/dispatch/index.ts @@ -270,8 +270,6 @@ export async function dispatchWorkFlow(data: Props): Promise