https://bugs.kde.org/show_bug.cgi?id=528957

            Bug ID: 528957
           Summary: Discover update check never finishes when no Flatpak
                    remotes are configured
    Classification: Applications
           Product: Discover
      Version First 6.7.5
       Reported In:
          Platform: Flatpak
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Flatpak Backend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
  Target Milestone: ---

DESCRIPTION
Discover never finishes checking for updates when Flatpak is installed but has
no remotes
configured. The updates page stays on "Checking for updates..." indefinitely,
even though
the available updates are already known (the count is displayed in the
sidebar). The
blocker is the Flatpak backend, not PackageKit.

STEPS TO REPRODUCE
1. Have Flatpak installed without any remotes: `flatpak remotes` prints
nothing, and both
   /var/lib/flatpak/repo/config and ~/.local/share/flatpak/repo/config contain
only the
   [core] group, no [remote "flathub"] section.
2. Start Discover: `plasma-discover --mode Update` (or open Discover and go to
Updates).
3. Wait. The page stays on "Checking for updates..." and the update list is
never shown.

   Reproduces also with a single backend: `plasma-discover --backends flatpak
--mode Update`
   hangs forever, while `--backends packagekit`, `--backends fwupd` and
`--backends kns`
   each finish the check normally.

OBSERVED RESULT
The updates page is stuck in the "fetching" state: the footer says "Checking
for updates...",
the updates view has opacity 0, while the sidebar already reports 604 available
updates.

While it is stuck, PackageKit is idle: `busctl --system call
org.freedesktop.PackageKit
/org/freedesktop/PackageKit org.freedesktop.PackageKit GetTransactionList`
returns an empty
list, and the journal shows refresh-cache and get-updates transactions
"finished with
success after 1-3 s".

Adding a single remote (in my case `flatpak remote-add --user flathub ...`)
makes the hang
go away immediately, both with `--backends flatpak` and with all backends. The
same system
without that remote reproduces the hang every time.

EXPECTED RESULT
The updates page shows the available updates, or "Up to date" when there are
none.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 44 (KDE Plasma Desktop Edition)
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.31.0
Qt Version: 6.11.2

ADDITIONAL INFORMATION
Graphics Platform: Wayland
Kernel Version: 7.2.11-200.fc44.x86_64
Flatpak 1.18.4, PackageKit 1.4.0, plasma-discover 6.7.5-2.fc44

I think the Flatpak updater simply never gets marked as "populated". In
libdiscover/resources/StandardBackendUpdater.cpp:

    return m_backend->fetchingUpdatesProgress() != 100 || m_settingUp ||
!m_hasBeenPopulated;

and m_hasBeenPopulated is only set from setSettingUp(false), which is reached
through
refreshUpdateable(). refreshUpdateable() in turn is only triggered by
AbstractResourcesBackend::contentsChanged or ::invalidated.

With no remotes, FlatpakBackend never emits any of those signals: its
constructor calls
loadAppsFromAppstreamData(), which iterates over an empty list of remotes, so
createPool()
and acquireFetching() are never reached. FlatpakBackend::isValid() is still
true (the
installation exists), so the backend stays loaded and just never produces a
signal. As a
result isFetchingUpdates() returns true forever,
ResourcesUpdatesModel::isFetching
aggregates it, and UpdatesPage remains in the "fetching" state.

Emitting contentsChanged() once at the end of the FlatpakBackend constructor,
or marking the
updater as populated in StandardBackendUpdater::prepare(), would avoid this.

Possibly related to bug 518096, but that report is about the appstream metadata
refresh
timing out. Here there is no remote at all and nothing times out; the check
just never ends.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to