[Bug]: Flatpak page shows flathub/stable for an app installed from flathub-beta (PrusaSlicer: 2.9.7 offered, 3.0.0 installed)
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
- 72/100
Hướng nghiên cứu
Bắt đầu từ src/flatpakclient.cpp, tại preferred() (dòng 49-56), hàm này sắp xếp các mục catalogue, ưu tiên flathub trước, rồi đến stable. Kiểm tra cách toItem() gộp mục catalogue đã chọn với ref đã cài đặt, và nơi installedRefs được xây dựng, vì bản sửa lỗi được đề xuất phụ thuộc vào điều này. Xong khi một ref beta đã cài đặt hiển thị remote và branch riêng của nó, còn các ứng dụng chưa cài đặt vẫn ưu tiên flathub/stable. Hãy xác nhận trước với maintainer hành vi mong đợi (khớp với ref đã cài đặt hoặc liệt kê cả hai).
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The Flatpak page offers the wrong copy of an app when the installed copy comes from a different remote or branch than the one the catalogue dedupe prefers. PrusaSlicer is installed from flathub-beta / branch beta, version 3.0.0, but the page shows flathub / branch stable, version 2.9.7 as the app's version, with "installed from flathub-beta".
Environment
- CachyOS rolling, KDE Plasma 6.8.3 / KWin Wayland
cachyos-packageinstaller2.0.0-1- flatpak 1.18.4
- Remotes:
flathub(system),flathub-beta(system),flathub(user)
Steps to reproduce
flatpak install flathub-beta com.prusa3d.PrusaSlicer(installs branchbeta, version 3.0.0)- Open the Package Installer, go to the Flatpak page, search for PrusaSlicer.
- The page reports 2.9.7 as the available version and the installed version as 3.0.0.
What the system reports
$ flatpak list --app --columns=application,branch,installation,origin,version
com.prusa3d.PrusaSlicer beta system flathub-beta 3.0.0
$ flatpak remote-ls --system flathub --app --columns=application,branch,version
com.prusa3d.PrusaSlicer stable 2.9.7
$ flatpak remote-ls --system flathub-beta --app --columns=application,branch,version
com.prusa3d.PrusaSlicer beta 3.0.0
Cause
src/flatpakclient.cpp, preferred() (lines 49-56):
/// Which of two offers of the same app is shown: Flathub before other remotes, the stable
/// branch before others, then by name so the choice never depends on the order of loading.
bool preferred(const FlatpakApp& a, const FlatpakApp& b) {
const auto rank = [](const FlatpakApp& app) {
return std::tuple(app.remote != "flathub"_L1, app.branch != "stable"_L1, app.remote, app.branch);
};
return rank(a) < rank(b);
}
The catalogue of every system remote is loaded and deduplicated per app id with preferred(), so the flathub/stable entry always wins — even when the installed ref is on another remote and branch. toItem() then mixes that entry with the installed copy: title and available version come from flathub/stable (2.9.7), while installedVersion, installedFrom and branch come from the installed beta copy.
The same ranking ignores the user installation, which is fine for the catalogue (the README says only system catalogs are read) but means an installed beta ref has no way to win.
Expected
When an app is installed, the offer should be the catalogue entry that matches the installed ref (same remote and branch) — or, if the catalogues disagree, both should be listed. Only uninstalled apps should fall back to "flathub, then stable".
Suggested fix
Rank by whether the ref is installed before the flathub/stable heuristics:
const auto rank = [&](const FlatpakApp& app) {
const bool isInstalled = std::ranges::any_of(installedRefs, [&](const auto& ref) { return ref == app.ref; });
return std::tuple(!isInstalled, app.remote != "flathub"_L1, app.branch != "stable"_L1, app.remote, app.branch);
};
Impact
The version shown for such an app is wrong, and the install/update action on that page targets the stable copy instead of the one the user is tracking. Updates themselves come from flatpak remote-ls --updates, so the update list is not affected — only the app offer and its displayed version.
- Ngôn ngữ chính
- C++
- Star
- 43
- Fork
- 39
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CachyOS/packageinstaller
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
CachyOS/packageinstaller#133 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
CachyOS/packageinstaller#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SIGSEGV in ~QMessageBox on Plasma - native message dialog helper is used after freeCó thể đã có người làm @wehrwolfmann đã nhận 92 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
CachyOS/packageinstaller#68 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
CachyOS/packageinstaller#143 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
CachyOS/packageinstaller#136 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CachyOS/packageinstaller
Issue tương tự
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
TomerAberbach/profiler-md#951 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Default key routing (JavaStringHash) picks a different partition than the Java client for about half of keysCó thể đã có người làm @0z5a đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/pulsar-client-go#1575 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pocoproject/poco#5764 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug cpp-core-guidelines low-priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
NatronGitHub/openfx-supportext#164 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày