2 Commits

Author SHA1 Message Date
Ryan 1509bc9f13 Account Modal Bugfix (#3687)
## Description:

Fix null stat values from LEFT JOIN causing Zod validation failure on
player profiles

https://github.com/openfrontio/infra/pull/316 switched playerStats from
innerJoin to leftJoin so that sessions with no stats row (games that
ended instantly on spawn) are still counted in wins/losses/total.


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

w.o.n
2026-04-16 13:18:55 -07:00
Scott Anderson 13f0c2303e bug: StatsSchema zod validation error (#1267)
## Description:

Fix a bug in the StatsSchema zod validation logic. In zod v4, the
`record` function has been renamed to `partialRecord`, and the new
`record` function requires that all keys are present. We intentionally
omit empty stats, so this causes a zod validation error.

Example error:

```
Connection error!
 game id: VSEtmKpJ, client id: 0UMrA84F
Error: ✖ Invalid input: expected array, received undefined
  → at allPlayersStats.0UMrA84F.units.wshp
✖ Invalid input: expected array, received undefined
  → at allPlayersStats.0UMrA84F.units.saml
Stack: 
```

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
2025-06-24 13:50:36 -07:00