Skip to content

Build stats not accounting for alt weapon skins #2586

@Sendouc

Description

@Sendouc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions