**Related issue:** Related to #47839
Follow-up to #47949 (same root cause, same issue). That PR fixed the
OR-dominance drop out in the software *title summary* queries; this
applies the same fix to the four per-host queries behind a host's
*software details* page.
A host with more than one queued install or uninstall for the same
installer, VPP app, or in-house app could disappear from its software
details page: the old self anti-join's `(priority < OR created_at >)`
predicate let two rows eliminate each other, so neither survived. This
rewrites those four queries (`hostSoftwareInstalls`,
`hostSoftwareUninstalls`, `hostVPPInstalls`, `hostInHouseInstalls`) to
rank with `ROW_NUMBER()` and keep one row per item. No performance
change — these are per-host queries.
# Checklist for submitter
- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or
`ee/fleetd-chrome/changes`. See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [x] `SELECT *` is avoided and SQL injection is prevented (named
placeholders used for all values in the modified statements).
## Testing
- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Fixed an issue where installers, VPP apps, and in-house apps could
disappear from a host's software details page when multiple install or
uninstall actions were queued for the same item.
* **Tests**
* Added regression tests to prevent this issue from recurring.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->