Skip to content

fix(plugin): detect updates for plugins without persisted install sources - #9887

Merged
Soulter merged 1 commit into
AstrBotDevs:masterfrom
xiaoyuyu6420:fix/9668-implicit-update-check
Sep 1, 2026
Merged

fix(plugin): detect updates for plugins without persisted install sources#9887
Soulter merged 1 commit into
AstrBotDevs:masterfrom
xiaoyuyu6420:fix/9668-implicit-update-check

Conversation

@xiaoyuyu6420

@xiaoyuyu6420 xiaoyuyu6420 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #9668

Problem

For plugins installed before the install-source persistence feature (PR #9037, v4.26.2), there is no persisted plugin_install_sources record. The backend falls back to an implicit source record (implicit: true) as a display-only placeholder.

The frontend update check (checkUpdate) skipped any extension whose install_source.implicit === true, so these legacy plugins never surfaced an available update — the user had to manually reinstall or re-bind the plugin source before the "update available" badge appeared.

Root cause

  • checkUpdate bails out early on source.implicit === true.
  • findMarketPluginForExtension also returns null for implicit sources, so even the update download URL could not be resolved.

Fix

Include implicit sources in the update check instead of skipping them:

  • Implicit records already carry install_method: "market" with a null registry_url, which resolves to the default registry. The existing matching logic then looks the plugin up in the default market by market_plugin_idrepo → name. Only a real match surfaces an update, so no false positives are introduced for unmatched plugins.
  • The update action still routes implicit plugins through the existing "bind source" dialog (via buildUpdateContext), so updating remains safe and the persisted record is created on confirm — matching the previously working "reinstall/change source" path.

Also fixes the misspelled online_vesiononline_version field in serialize_plugin_base so the backend payload matches what the frontend reads.

Testing

  • node --check dashboard/src/views/extension/useExtensionPage.js passes.
  • Backend change is a field rename only; no test references the old name.

Summary by Sourcery

Restore update detection for legacy market plugins while correcting the plugin version payload field.

Bug Fixes:

  • Detect available updates for legacy plugins without persisted install-source records.
  • Correct the serialized plugin version field name so frontend update data is populated correctly.

…rces

Legacy plugins installed before install-source persistence (PR AstrBotDevs#9037) have
no plugin_install_sources record, so the backend falls back to an implicit
source record. The frontend update check skipped implicit sources entirely,
so these plugins never showed available updates until the user manually
re-bound or reinstalled the plugin.

Include implicit sources in the update check: they resolve to the default
registry, so match them against the default market by repo/name. Only
matched plugins surface an update; unmatched ones stay silent, so this
cannot introduce false positives. Also fix the misspelled online_vesion
field name so the backend payload matches what the frontend reads.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Soulter
Soulter merged commit bc3b1c6 into AstrBotDevs:master Sep 1, 2026
21 checks passed
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.

[Bug] 最新版本中插件更新检测失效,重新安装或更换插件源后才显示更新

2 participants