Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
502647092 opened this issue Dec 28, 2023 · 2 comments
Open
Labels
bug Something isn't working plugin: config

Comments

@502647092
Copy link

复现方式

  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 502647092 changed the title bug: 停用分组后 操作分组内的插件 会报错 Bug: plugin-config 停用分组后 操作分组内的插件 会报错 Dec 28, 2023
@shigma shigma added plugin: config bug Something isn't working labels Dec 28, 2023
@CyanChanges
Copy link
Contributor

CyanChanges commented Feb 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin: config
Projects
None yet
Development

No branches or pull requests

3 participants