Bug Description
Build stats are not taking into account alt skins of a weapon. For example, Slosher stats should also include Order Slosher builds, but currently they are counted separately.
Affected Functions
abilityPointAverages() in app/features/builds/BuildRepository.server.ts
popularAbilitiesByWeaponId() in app/features/builds/BuildRepository.server.ts
Proposed Fix
The fix involves changing the weapon ID filtering to use weaponIdToArrayWithAlts(weaponSplId) instead of filtering by a single weapon ID:
- .where("BuildWeapon.weaponSplId", "=", weaponSplId)
+ .where(
+ "BuildWeapon.weaponSplId",
+ "in",
+ weaponIdToArrayWithAlts(weaponSplId),
+ )
Additionally, adds groupBy("Build.id") to flatten builds with multiple weapons.
Note: This is not a complete solution. The groupBy("Build.id") would cause problems because the same build would be counted twice for stats. A more comprehensive fix is needed.
Performance testing required: Ensure the query remains efficient with the expanded weapon filtering.
Bug Description
Build stats are not taking into account alt skins of a weapon. For example, Slosher stats should also include Order Slosher builds, but currently they are counted separately.
Affected Functions
abilityPointAverages()inapp/features/builds/BuildRepository.server.tspopularAbilitiesByWeaponId()inapp/features/builds/BuildRepository.server.tsProposed Fix
The fix involves changing the weapon ID filtering to use
weaponIdToArrayWithAlts(weaponSplId)instead of filtering by a single weapon ID:Additionally, adds
groupBy("Build.id")to flatten builds with multiple weapons.Note: This is not a complete solution. The
groupBy("Build.id")would cause problems because the same build would be counted twice for stats. A more comprehensive fix is needed.Performance testing required: Ensure the query remains efficient with the expanded weapon filtering.