Commit 5e288f61 authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈

Reset entry to updateable when no payload is identified for updating

As identified by Piotr in the bug mentioned below, Discover simply
returns an invalid response for any Question forwarded to it. The result
is that any update which fails to identify an update automatically will
fail due to not having payload which should be used for updating identified.

This patch fixes part of the issue, by resetting the entry for which no
payload could be identified to Updateable rather than leaving it in
limbo as Updating.

This does not fix the bug in Discover, but it does at least alleviate
the issue (it still leaves entries in Discover, rather than updating
them, but without having a way to forward that question to the user,
there's not a lot to be done about that other than output an error
message with instructions to use the GHNS dialog to do that particular
update, which of course is not exactly up to par... so, not closing the
bug with this, the issue in Discover still needs sorting out... somehow).

parent 4a406270
......@@ -766,6 +766,10 @@ void Engine::downloadLinkLoaded(const KNSCore::EntryInternal &entry)
} else {
qCWarning(KNEWSTUFFCORE) << "We failed to identify a good link for updating" << << "and are unable to perform the update";
KNSCore::EntryInternal theEntry(entry);
Q_EMIT signalEntryEvent(theEntry, EntryInternal::StatusChangedEvent);
Q_EMIT signalErrorCode(ErrorCode::InstallationError, i18n("We failed to identify a good link for updating %1, and are unable to perform the update",, {entry.uniqueId()});
// As the serverside data may change before next time this is called, even in the same session,
// let's not make assumptions, and just get rid of this
......@@ -28,7 +28,7 @@ namespace KNSCore
OcsError, ///< An error reported by the OCS API server. In signalErrorCode, this will be accompanied by the OCS error code in the metadata
ConfigFileError, ///< The configuration file is missing or somehow incorrect. The configuration file filename will be held in the metadata
ProviderError, ///< A provider has failed to load or initialize. The provider file URL or provider URL will be held in the metadata
InstallationError, ///< Installation of a content item has failed
InstallationError, ///< Installation of a content item has failed. If known, the entry's unique ID will be the metadata
ImageError, ///< Loading an image has failed. The entry name and preview type which failed will be held in the metadata as a QVariantList
AdoptionError, ///< Adopting one entry has failed. The adoption command will be in the metadata as a QVariantList.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment