webui icon indicating copy to clipboard operation
webui copied to clipboard

Bug: plugin-config 停用分组后 操作分组内的插件 会报错

Open 502647092 opened this issue 1 year ago • 2 comments

复现方式

  1. 新建分组
  2. 分组内添加插件
  3. 停用分组
  4. 启用或停用分组内的插件

错误日志

loader TypeError: Cannot read properties of undefined (reading 'ctx')
                            at Proxy.unload (/home/project/TSWorkSpace/koishi/development/koishi-dev/node_modules/@koishijs/plugin-config/src/shared/writer.ts:153:30)
                            at _Client.ctx.console.addListener.authority (/home/project/TSWorkSpace/koishi/development/koishi-dev/node_modules/@koishijs/plugin-config/src/shared/writer.ts:59:27)
                            at WebSocket.receive (/home/project/TSWorkSpace/koishi/development/koishi-dev/node_modules/@koishijs/plugin-console/node_modules/@koishijs/console/src/client.ts:35:45)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

分组停用后 应该禁止操作分组内的插件 只允许修改配置

502647092 avatar Dec 28 '23 03:12 502647092

image 复现了, 但是我这个复现方式这种情况在正常使用的时候不会用到(
manager/unload 那个 ConfigWriter.unload 的 config 参数是空 Object ({}) 的时候就炸了 用这个 koishi-plugin-expose-ctx 就可以拿到 @koishijs/client 的 send as sendClient 了(

CyanChanges avatar Feb 16 '24 06:02 CyanChanges

https://cdn.discordapp.com/attachments/1181941664735043584/1207951121000173650/2024-02-16_15-25-18.mkv?ex=65e18325&is=65cf0e25&hm=92faf69a7a495add6199a791cd6d7581599e39ee8a116f6f3b3d179674da6a98&

https://github.com/koishijs/webui/assets/68551684/31a2f4b1-9e07-486c-a5b4-a14f7e5fd891

image image

CyanChanges avatar Feb 16 '24 07:02 CyanChanges