Bug 432657

Summary: Launching Discover spawns up to 100 get-details operations
Product: [Applications] Discover Reporter: Nate Graham <nate>
Component: discoverAssignee: Dan Leinir Turthra Jensen <leinir>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol
Priority: NOR    
Version First Reported In: 5.20.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.21
Sentry Crash Report:
Attachments: Too many get-details operations

Description Nate Graham 2021-02-08 18:19:09 UTC
Created attachment 135518 [details]
Too many get-details operations

Everything KDE from git master.

I wonder if this could be contributing to slowness on launch. See attached screen recording of `pkmon` output after Discover is launched.
Comment 1 Aleix Pol 2021-02-09 15:34:51 UTC
Git commit b9f709b968f419b8f61a00ec22fa0b3a22c33dbc by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 09/02/2021 at 15:34.
Pushed by apol into branch 'master'.

pk: no need to fetch the details of the updatable packages

When the details are required, they'll be requested. This way we don't
fetch the updatable packages updates when the user just wants to find an
app.

M  +0    -1    libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp

https://invent.kde.org/plasma/discover/commit/b9f709b968f419b8f61a00ec22fa0b3a22c33dbc
Comment 2 Aleix Pol 2021-02-09 15:34:59 UTC
Git commit 76780c7159fadb219499d2cafc7c72ce77d97799 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 09/02/2021 at 15:34.
Pushed by apol into branch 'master'.

pk: Don't call the size function as it triggers a details fetch

We are only checking the previous size to see if it needs to emit a
change, we were fetching twice in practice.

M  +2    -2    libdiscover/backends/PackageKitBackend/PackageKitResource.cpp

https://invent.kde.org/plasma/discover/commit/76780c7159fadb219499d2cafc7c72ce77d97799
Comment 3 Aleix Pol 2021-02-09 15:35:29 UTC
Git commit 6440e8f76f0ad05c533ec53f36d4e39638c475eb by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 09/02/2021 at 15:35.
Pushed by apol into branch 'Plasma/5.21'.

pk: no need to fetch the details of the updatable packages

When the details are required, they'll be requested. This way we don't
fetch the updatable packages updates when the user just wants to find an
app.


(cherry picked from commit b9f709b968f419b8f61a00ec22fa0b3a22c33dbc)

M  +0    -1    libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp

https://invent.kde.org/plasma/discover/commit/6440e8f76f0ad05c533ec53f36d4e39638c475eb
Comment 4 Aleix Pol 2021-02-09 15:36:03 UTC
Git commit 71435f22fdf4a91c916abb01a1c10414bd5f15db by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 09/02/2021 at 15:35.
Pushed by apol into branch 'Plasma/5.21'.

pk: Don't call the size function as it triggers a details fetch

We are only checking the previous size to see if it needs to emit a
change, we were fetching twice in practice.


(cherry picked from commit 76780c7159fadb219499d2cafc7c72ce77d97799)

M  +2    -2    libdiscover/backends/PackageKitBackend/PackageKitResource.cpp

https://invent.kde.org/plasma/discover/commit/71435f22fdf4a91c916abb01a1c10414bd5f15db
Comment 5 Nate Graham 2021-02-09 18:43:09 UTC
This is fully fixed now for me.