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

Đang mở Phù hợp với người mới
#2,469 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong ExtensionControlService#updateExtension, lần theo các nhánh cho deprecated và replacementId và cách replacementChanged điều khiển việc làm mới cache và tìm kiếm. Thêm vào ExtensionControlServiceTest một trường hợp thất bại trong đó một extension deprecated có replacement đã tồn tại nhưng file control giờ không cung cấp replacement nào, sau đó làm cho service đặt replacement thành null và đặt replacementChanged. Hoàn tất nghĩa là test đó chạy qua và đường làm mới chạy cho trường hợp này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
2.1k
Fork
362
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
44

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-openvsx/openvsx

Tất cả issue của eclipse-openvsx/openvsx

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.