Skip to content

Commit

Permalink
fix: guard against missing plugin schema (#1662)
Browse files Browse the repository at this point in the history
Loading the configuration form for a plugin with no schema
would crash the configuration ui and the browser would
persist the configuration ui state so that subsequent
attempts to navigate to plugin configuration would try
to open the problematic plugin's configuration, again
resulting in a ui crash.

Change the server to always provide an empty schema in
case the plugin is not defining one and log an error
message about it when the plugin configuration page
is loaded.
  • Loading branch information
tkurki authored Jan 4, 2024
1 parent 4eeabc1 commit 4b6ca3a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/interfaces/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,19 @@ module.exports = (theApp: any) => {
.then(([schema, uiSchema]) => {
const status = providerStatus.find((p: any) => p.id === plugin.name)
const statusMessage = status ? status.message : ''
if (schema === undefined) {
console.error(
`Error: plugin ${plugin.id} is missing configuration schema`
)
}
resolve({
id: plugin.id,
name: plugin.name,
packageName: plugin.packageName,
keywords: plugin.keywords,
version: plugin.version,
description: plugin.description,
schema,
schema: schema || {},
statusMessage,
uiSchema,
state: plugin.state,
Expand Down

0 comments on commit 4b6ca3a

Please sign in to comment.