moonming commented on issue #3412:
URL:
https://github.com/apache/apisix-dashboard/issues/3412#issuecomment-4932692734
Confirmed on current `master` (`9979b31`), and I can point at the exact root
cause.
The page fires one `GET /apisix/admin/plugin_metadata/{name}` per
metadata-capable plugin (I captured 24 individual 404s on a fresh instance).
The per-request interceptor opt-out is in
`src/components/page-slice/plugin_metadata/hooks.ts`:
```ts
...getPluginMetadataQueryOptions(pluginName, {
// skip show 500 error toast
[SKIP_INTERCEPTOR_HEADER]: ['500'],
}),
```
The skip list contains `'500'`, but the Admin API returns **404** (`Key not
found`) for a plugin whose metadata was never configured — so every 404 falls
through to the global axios interceptor and toasts. The `'500'` entry guards
the wrong status code.
There's also a quieter sibling bug in the same hook: the success/failure
branch treats **any** failed metadata GET as "not configured" (`config: {}`),
including genuine 500s/network failures on a plugin that *does* have metadata —
with the toast suppressed, a user who then opens that plugin and saves will
overwrite their existing metadata with `{}` without any hint that the original
fetch failed.
PR incoming: add `'404'` to the skip list, branch the state on `status ===
404` (unconfigured) vs anything else (error state, don't offer an empty
editable config), plus an e2e asserting a fresh instance's Plugin Metadata page
shows zero error toasts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]