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

Aperta Adatta ai principianti
#2,469 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend

Direzione di ricerca

Inizia in ExtensionControlService#updateExtension, seguendo i branch per deprecated e replacementId e come replacementChanged guida l'aggiornamento di cache e ricerca. Aggiungi a ExtensionControlServiceTest un caso che fallisce in cui un'estensione deprecated ha un replacement esistente ma il file di controllo ora non ne fornisce nessuno, poi fai in modo che il servizio porti il replacement a null e imposti replacementChanged. Fatto significa che quel test passa e il percorso di aggiornamento viene eseguito per questo caso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
2.1k
Fork
362
Merge medio
1g 3h
PR unite (30g)
44

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-openvsx/openvsx

Tutte le issue di eclipse-openvsx/openvsx

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.