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

fix(commands): make CommandManager.config indepedent from its scope.config #333

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hieuzest
Copy link

CommandManager.config 和 CommandManager.ctx.scope.config 在初始化时为同一值,这将导致 CommandManager.update() 先重写配置项后触发 ctx.scope.update(), 此时 ctx.scope.config 已经被修改,导致 internal/before-update 中无法区分是否改动。 而 ctx.scope.update() 中调用了 schema(), 因此后续并不会出现问题。因而此pr在初始化时强制让二者独立来避免此问题。

CommandManager.config 和 CommandManager.ctx.scope.config 在初始化时为同一值,这将导致 CommandManager.update() 先重写配置项后触发 ctx.scope.update(), 此时 ctx.scope.config 已经被修改,导致 internal/before-update 中无法区分是否改动。
而 ctx.scope.update() 中调用了 schema(), 因此后续并不会出现问题。因而此pr在初始化时强制让二者独立来避免此问题。
@Hieuzest Hieuzest changed the title fix(commands): prevent overwriting oldconfig of commands fix(commands): make CommandManager.config indepedent from its scope.config Aug 23, 2024
@Hieuzest Hieuzest requested a review from shigma August 24, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant