monkey icon indicating copy to clipboard operation
monkey copied to clipboard

Submitting configuration for plugin without modification can result in "Invalid configuration" message

Open cakekoa opened this issue 2 years ago • 0 comments

Describe the bug

When we addressed #3839, we solved the immediate issue by removing the "required" constraint on all of fields in the config schema for each plugin. However, that does not solve the problem of the Island encountering problems with any future plugin that has both required and a default value specified for a given field in the config schema. That problem is rooted in the fact that:

  1. The UI does not provide the default values in the agent configuration that it sends to the server. The plugin's configuration will be empty.
  2. The server, upon receiving the agent configuration and prior to processing it, validates it against the agent configuration schema. If the plugin's fields are required, it will fail validation against the empty configuration.

To Reproduce

Steps to reproduce the behavior:

See #3839. Any plugin with both required and a default value for a field in its config schema will trigger the problem. Our mock plugin is still configured this way.

Expected behavior

Currently, from the user's perspective, the plugin's options are filled with the defaults (provided from the schema). It is expected that these values will be sent in the configuration to the server, if the plugin is enabled.

Machine version (please complete the following information):

  • OS: Windows or Linux

cakekoa avatar Nov 01 '23 12:11 cakekoa