Skip to content

Implement Config Refresh on Middleware Side#37

Merged
psmit03 merged 1 commit intomainfrom
add-keyword-refresh
Apr 11, 2025
Merged

Implement Config Refresh on Middleware Side#37
psmit03 merged 1 commit intomainfrom
add-keyword-refresh

Conversation

@psmit03
Copy link
Member

@psmit03 psmit03 commented Apr 10, 2025

This one line change adds a call to LoadYaml() inside of the putYamlHandler function.

This PR works in tandem with changes coming to the GUI repo. On the GUI repo, there will be a change added which fetch the keyword every time the user switches to the SpeechInput component.

Why?
The issue we were running into was that the configuration (including the keyword) is only loaded when the server starts via config.LoadYaml. Changing the file via the API from the frontend doesn't refresh the in-memory config.

To fix this, we added the config.LoadYaml() call after updating the file in putYamlHandler.

Result:
Now when putYamlHandler is called from the frontend when the user submits a PUT call, configs are reloaded and the user can then fetch the new keyword every time they switch to the speech input component. This results in the keyword being properly updated on the SpeechInput component after being edited during the user's current session of the GUI.

Screen.Recording.2025-04-09.at.11.11.23.PM.mov

Copilot AI review requested due to automatic review settings April 10, 2025 03:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

return
}

config.LoadYaml()
Copy link

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to config.LoadYaml() does not handle potential errors. Consider capturing and handling errors from config.LoadYaml() (e.g., logging the error and returning an appropriate HTTP error status) to ensure that configuration loading failures are not silently ignored.

Copilot uses AI. Check for mistakes.
@psmit03 psmit03 merged commit b43d60f into main Apr 11, 2025
1 check passed
@psmit03 psmit03 deleted the add-keyword-refresh branch April 11, 2025 03:27
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.

3 participants