-
Notifications
You must be signed in to change notification settings - Fork 104
fix: watch providers.jsonc for external edits so UI refreshes without restart #3233
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,6 +141,8 @@ export class ProviderService { | |
| // The provider config subscription may have many concurrent listeners (e.g. multiple windows). | ||
| // Avoid noisy MaxListenersExceededWarning for normal usage. | ||
| this.emitter.setMaxListeners(50); | ||
| // Notify subscribers when providers.jsonc is edited externally (e.g. manual edits). | ||
| this.config.watchProvidersFile(() => this.notifyConfigChanged()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The constructor starts a filesystem watch via Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
watchProvidersFile()callsfs.watch(this.rootDir, ...)unconditionally, butConfigdoes not guaranteerootDirexists beforeProviderServiceis constructed. On first run (or whenMUX_ROOTpoints to a not-yet-created directory),fs.watchthrowsENOENTsynchronously, which abortsProviderServiceconstruction and can crash startup before recovery logic runs.Useful? React with 👍 / 👎.