Skip to content

fix(software): paginate host software pages by distinct title IDs - #41351

Closed
SergioChan wants to merge 1 commit into
fleetdm:mainfrom
SergioChan:fix-host-software-pagination
Closed

fix(software): paginate host software pages by distinct title IDs#41351
SergioChan wants to merge 1 commit into
fleetdm:mainfrom
SergioChan:fix-host-software-pagination

Conversation

@SergioChan

Copy link
Copy Markdown

Related issue: Resolves #41277

Summary

  • paginate ListHostSoftware using a distinct title-id query first, then fetch/hydrate rows only for that page of title IDs
  • preserve page ordering by applying ORDER BY FIELD(id, ...) when loading detailed rows for dedup/hydration
  • extend testListHostSoftwarePaginationWithMultipleInstallers to verify page 1 contains a full page with no overlap against page 0

Testing

  • Added/updated automated tests
  • Where appropriate, automated tests simulate multiple hosts and test for host isolation
  • QA'd all new/changed functionality manually

Validation run in this environment:

  • go test ./server/datastore/mysql -run TestDatastoreReplica -count=1

Note: the ListHostSoftwarePaginationWithMultipleInstallers integration-style datastore test was updated but not executable in this runtime because the required datastore integration harness (seeded MySQL test setup) is not active in this isolated run.

@codecov

codecov Bot commented Mar 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.12500% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.98%. Comparing base (fc5f249) to head (b47b4fc).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
server/datastore/mysql/software.go 28.12% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #41351      +/-   ##
==========================================
- Coverage   66.36%   65.98%   -0.39%     
==========================================
  Files        2477     2477              
  Lines      198496   198527      +31     
  Branches     8891     8891              
==========================================
- Hits       131729   130995     -734     
- Misses      54865    55624     +759     
- Partials    11902    11908       +6     
Flag Coverage Δ
backend 67.71% <28.12%> (-0.45%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@iansltx

iansltx commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Already fixed in #41300. Closing.

@iansltx iansltx closed this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host software pagination returns short/overlapping pages when a title has multiple installers

2 participants