Bug 486726 - discover needs to include the fwupd version in the user agent
Summary: discover needs to include the fwupd version in the user agent
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: fwupd Backend (other bugs)
Version First Reported In: master
Platform: Other Linux
: NOR task
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-07 13:17 UTC by Richard Hughes
Modified: 2024-07-16 10:04 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Hughes 2024-05-07 13:17:32 UTC
When downloading files from the LVFS (fwupd.org) the user agent is of the form `plasma-discover/5.27.8` which doesn't include the fwupd version. Server-side we're expecting a user agent like `plasma-discover/5.27.8 fwupd/1.9.9` which allows us to select the best file for the given fwupd version -- for instance supplying the version with compression turned on if the fwupd version is new enough, and also checking that the fwupd version isn't too old to understand the requirement format strings set in the metadata.

STEPS TO REPRODUCE
1. Launch discover
2. Install a firmware update
3. Hope that you got the correct one

OBSERVED RESULT

It works, but only by accident.

EXPECTED RESULT

It works all the time.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: it seems, but unverified, all.
Comment 1 Bug Janitor Service 2024-05-07 14:43:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/832
Comment 2 Kai Uwe Broulik 2024-05-08 06:26:28 UTC
Git commit 3d5ad3e32c273000720738b834aa0aedd1f0b23a by Kai Uwe Broulik.
Committed on 08/05/2024 at 06:22.
Pushed by broulik into branch 'master'.

FwupdBackend: Set user agent from client

Ensures it include any information fwupd expects/sets,
such as the fwupd version, distro version,
in addition to our package version.

M  +3    -2    libdiscover/backends/FwupdBackend/FwupdTransaction.cpp

https://invent.kde.org/plasma/discover/-/commit/3d5ad3e32c273000720738b834aa0aedd1f0b23a
Comment 3 Kai Uwe Broulik 2024-05-08 07:13:50 UTC
Git commit 33202c20e7fa28b20710f5a665e882683ac8a0d9 by Kai Uwe Broulik.
Committed on 08/05/2024 at 06:29.
Pushed by broulik into branch 'Plasma/6.0'.

FwupdBackend: Set user agent from client

Ensures it include any information fwupd expects/sets,
such as the fwupd version, distro version,
in addition to our package version.


(cherry picked from commit 3d5ad3e32c273000720738b834aa0aedd1f0b23a)

M  +3    -2    libdiscover/backends/FwupdBackend/FwupdTransaction.cpp

https://invent.kde.org/plasma/discover/-/commit/33202c20e7fa28b20710f5a665e882683ac8a0d9
Comment 4 Richard Hughes 2024-05-08 08:28:04 UTC
Wonderful, thanks for the speedy fix!
Comment 5 Kai Uwe Broulik 2024-07-16 10:04:13 UTC
Git commit dfc07eea5aafd47ea213160c869d90dd9b0d0bba by Kai Uwe Broulik.
Committed on 16/07/2024 at 09:56.
Pushed by broulik into branch 'Plasma/5.27'.

FwupdBackend: Set user agent from client

Ensures it include any information fwupd expects/sets,
such as the fwupd version, distro version,
in addition to our package version.


(cherry picked from commit 3d5ad3e32c273000720738b834aa0aedd1f0b23a)

(cherry picked from commit 33202c20e7fa28b20710f5a665e882683ac8a0d9)

M  +3    -2    libdiscover/backends/FwupdBackend/FwupdTransaction.cpp

https://invent.kde.org/plasma/discover/-/commit/dfc07eea5aafd47ea213160c869d90dd9b0d0bba