Extension control: removing the replacement from a deprecated entry does not clear it

オープン 初心者向け
#2,469 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
backend

調査の方向性

ExtensionControlService#updateExtension から始め、deprecated と replacementId の分岐、および replacementChanged がキャッシュと検索のリフレッシュをどのように駆動するかを追ってください。ExtensionControlServiceTest に、deprecated な拡張機能に既存の replacement があるが control ファイルが今は何も提供しない場合の失敗するケースを追加し、その後サービスが replacement を null にして replacementChanged を設定するようにしてください。完了とは、そのテストが通り、このケースでリフレッシュ経路が実行されることです。

索引モデルが issue の本文から書いたものです。

説明

bug

Description

When an entry in extension-control/extensions.json (publish-extensions) stays deprecated but its extension (replacement) block is removed, the server keeps the previously stored replacement.

ExtensionControlJobRequestHandler#processDeprecatedExtensions computes replacementId = null when extension is absent and calls ExtensionControlService#updateExtension(id, true, null, downloadable). In updateExtension a null replacement is only acted on when !deprecated (the replacement is cleared). For a still-deprecated extension neither the !deprecated branch nor the replacementId != null branch runs, so extension.getReplacement() is unchanged. replacementChanged stays false, so the cached extension JSON and search entry are not refreshed either.

Observed

redhat.devspaces-copilot-chat-integration was deprecated in EclipseFdn/publish-extensions#1165 with a replacement pointing at itself (a typo). EclipseFdn/publish-extensions#1222 removes the extension block. Once merged, the server would still return the self-referencing replacement:

https://open-vsx.org/api/redhat/devspaces-copilot-chat-integration currently returns deprecated: true and replacement pointing to redhat/devspaces-copilot-chat-integration.

Expected

If the control file lists the extension as deprecated without a replacement, the stored replacement is set to null, and the caches and search entry are refreshed through the existing replacementChanged handling.

Suggested fix

In ExtensionControlService#updateExtension, set the replacement to null when deprecated is true and replacementId is null. ExtensionControlServiceTest has no case for a deprecated extension whose existing replacement is dropped; add one that fails without the fix.

Related: #2260 (same job, un-deprecation case). Until the fix is deployed, the stale value would need to be cleared manually in the DB, together with a cache eviction.

主要言語
Java
スター
2.1k
フォーク
362
平均マージ
1日 3時間
マージ済み PR(30日)
44

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eclipse-openvsx/openvsx のほかの issue

eclipse-openvsx/openvsx の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。