fix(plugins): check and update installed plugins with provenance guards
This commit is contained in:
1 parent
d715b16ba5
commit
cab674299a
26 files changed
+1180
-44
No files matched your search
@@ -28,7 +28,7 @@ const settings = {
|
||||
vi.mock("@/lib/backend/api", () => mocks);
|
||||
vi.mock("@/stores/settingsStore", () => ({ useSettingsStore: () => settings }));
|
||||
vi.mock("@/i18n", () => ({ currentLocale: () => "zh-CN" }));
|
||||
vi.mock("@/lib/plugins/pluginMarketplace", () => ({ buildMarketplacePluginListings: mocks.buildMarketplacePluginListings }));
|
||||
vi.mock("@/lib/plugins/pluginMarketplace", async (importOriginal) => ({ ...(await importOriginal<object>()), buildMarketplacePluginListings: mocks.buildMarketplacePluginListings }));
|
||||
|
||||
const mcpStatus = {
|
||||
installed: true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { computed, ref } from "vue";
|
||||
import * as api from "@/lib/backend/api";
|
||||
import { currentLocale } from "@/i18n";
|
||||
import { buildMarketplacePluginListings, type MarketplacePluginListing } from "@/lib/plugins/pluginMarketplace";
|
||||
import { buildMarketplacePluginListings, pluginSourceChange, type MarketplacePluginListing } from "@/lib/plugins/pluginMarketplace";
|
||||
import { mcpUpdateAvailability } from "@/lib/mcp/mcpUpdateStatus";
|
||||
import { useSettingsStore } from "@/stores/settingsStore";
|
||||
import { isUpdatePreviewMockEnabled, previewDriverUpdates, previewJdbcUpdate, previewMcpUpdate, previewPluginUpdates } from "@/lib/updates/updatePreviewMock";
|
||||
@@ -150,7 +150,10 @@ export function useComponentUpdates(options: { isDesktop: boolean }) {
|
||||
}
|
||||
|
||||
async function updatePlugins(result: ComponentUpdateResult) {
|
||||
const updatable = pluginUpdates.value.filter((item) => item.artifact);
|
||||
// Listings whose recorded provenance differs from the offering repository/publisher/key need an
|
||||
// explicit confirmation, which the automatic path cannot give: keep them visible in the update
|
||||
// center (they still count) but let the user confirm them in the Plugin Center instead.
|
||||
const updatable = pluginUpdates.value.filter((item) => item.artifact && !pluginSourceChange(item));
|
||||
if (isUpdatePreviewMockEnabled()) {
|
||||
result.plugins += updatable.length;
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user