[Bug]: remote-ls --updates reports up-to-date OCI refs because it ignores deployed Alt-id

クローズ 初心者向け
#6,874 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

関連するプルリクエストがすでにマージされています。

  • #6875 @Joao-kouznetz による — マージ済み

評価

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

調査の方向性

app/flatpak-builtins-remote-ls.c の opt_only_updates フィルタから始めてください。このフィルタは現在、リモートのチェックサムをデプロイ済みのコミットとだけ比較しています。flatpak_dir_needs_update_for_commit_and_subpaths() が Alt-id も受け付けている仕組みを確認したうえで、チェックサムがどちらの識別子とも一致する場合は、そのrefを一覧から除外するようにしてください。tests/test-oci-registry.sh を実行します。新しい no-updates-after-install のアサーションがすべての OCI バリアントで成功し、既存の更新チェックも引き続き成功すれば完了です。

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

説明

Problem

flatpak remote-ls --updates reports already installed applications and runtimes from an OCI remote as pending updates, while flatpak update correctly reports nothing to update.

This is a focused report of the OCI mismatch also described in #6714, which was closed after discussing the unrelated flatpak list --columns=latest behavior. It also resembles #3748.

Environment
  • Fedora Linux 44, x86_64
  • Flatpak 1.18.4 (1.18.4-1.fc44)
  • Fedora remote: oci+https://registry.fedoraproject.org
  • Also reproduced in upstream main at f2df7b090b69487f812f4ea389edffca0f5a4610 using the existing fake OCI registry tests.
Reproduction

With an already updated application installed from the Fedora OCI remote:

flatpak remote-ls --system --updates --columns=app fedora
flatpak update --system org.mozilla.firefox
flatpak info --system org.mozilla.firefox
flatpak remote-info --system fedora org.mozilla.firefox

The first command lists Firefox and five installed Fedora runtimes/extensions on this machine; the update transaction reports nothing to update.

For Firefox 156.0.1:

  • Installed OSTree commit: b306883250448dca17929560c62733e68c612ad4c14dac75e70a0f31cc92e038
  • Installed Alt-id: 5346c30ccd813306ff00a515c913335952c4353e32d5ecc344479068a71ab384
  • Remote commit: 5346c30ccd813306ff00a515c913335952c4353e32d5ecc344479068a71ab384
Cause and proposed correction

The opt_only_updates filter in app/flatpak-builtins-remote-ls.c compares the remote checksum only against flatpak_deploy_data_get_commit(). OCI remotes return the image digest, which matches the deployed Alt-id instead.

The transaction path already handles both identities in flatpak_dir_needs_update_for_commit_and_subpaths(). The listing should similarly exclude a ref when the checksum equals either its installed commit or Alt-id, preserving the existing origin check.

Regression coverage and validation

A regression test added to tests/test-oci-registry.sh checks:

  1. No updates immediately after installing an OCI app and runtime.
  2. Only the app is listed after publishing a genuine new OCI image.
  3. No updates after applying that update.

Before the fix, the first assertion fails with org.test.Hello and org.test.Platform incorrectly listed. After the fix, all four user/system × HTTP/HTTPS OCI registry variants pass (20 subtests each, 80 total). The locally built fixed CLI also reports zero Fedora updates on the affected installation, versus six with the installed CLI.

Workaround

Use flatpak update to check and apply actual updates rather than treating this OCI remote-ls --updates output as authoritative. The discrepancy can make GNOME Software appear to miss updates even when these particular refs are already current; this report does not establish a GNOME Software defect.

A corresponding patch and regression tests will follow in a PR. I agree to follow the project Code of Conduct.

主要言語
C
スター
5.1k
フォーク
526
平均マージ
17時間 12分
マージ済み PR(30日)
26

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

flatpak/flatpak のほかの issue

flatpak/flatpak の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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