Skip to content

Software fetched twice on Device User Page (performance issue) #19618

@getvictor

Description

@getvictor

Fleet version:
4.50.0
Web browser and operating system:


💥  Actual behavior

When user clicks on Fleet Desktop icon and goes to the Device User Page, all the software is fetched right away with the host. The host may have over 1000 software items. All this data is fetched and not used. Then, when clicking the Software tab, software is fetched again via a different API.

When user refetches host details, all the software is again fetched multiple times via the hosts API. This is 100s of KBs that is never used.

🧑‍💻  Steps to reproduce

  1. Click on Fleet Desktop icon and go to My Device.
  2. Click on Software tab -- note that software is fetched using a different API.

🕯️ More info (optional)

We had the same issue on the Host Details page, which was fixed as part of #19348

The backend part of the fix is trivial—add the exclude_software query param, as in the #19348 fix.

This frontend fix is slightly more complex because the existence of software in the host response is used to imply the isSoftwareEnabled config by the frontend.

    // TODO: This is a temporary fix that conditionally shows the new software tab depending on
    // whether software items returned in the device details response (legacy endpoint).
    // If the tab is selected, we call the new host software endpoint and display those results.
    // Software in the legacy response is only being used as a proxy for `iseSoftwareEnabled`.    <------ TYPO!!!
    // Ideally we should be checking the config for whether software is enabled to show/hide the tab,
    // but it isn't available via device token authenticated API. And we need better specified empty states.
    const isSoftwareEnabled = !!host?.software?.length;

Why not simply use the new software API endpoint and imply the config from that response?

Metadata

Metadata

Assignees

Labels

#g-endpoint-opsEndpoint ops product group#g-mdmMDM product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.bugSomething isn't working as documented~backendBackend-related issue.~frontendFrontend-related issue.~released bugThis bug was found in a stable release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions