stack/apps
BilalG1 3b6f9ee4fe
fix metrics queries (#880)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Fixes handling of `isAnonymous` field in metrics queries by using
`COALESCE` to default null values to 'false' in `route.tsx`.
> 
>   - **Behavior**:
> - Fixes handling of `isAnonymous` field in metrics queries by using
`COALESCE` to default null values to 'false'.
> - Affects `loadUsersByCountry`, `loadDailyActiveUsers`, and
`loadRecentlyActiveUsers` functions in `route.tsx`.
>   - **Functions**:
> - `loadUsersByCountry`: Updates query condition to use `COALESCE` for
`isAnonymous`.
> - `loadDailyActiveUsers`: Updates query condition to use `COALESCE`
for `isAnonymous`.
> - `loadRecentlyActiveUsers`: Updates query condition to use `COALESCE`
for `isAnonymous`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for b3ad219430. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

<!-- RECURSEML_SUMMARY:START -->
## Review by RecurseML

_🔍 Review performed on
[9318e2b..b3ad219](9318e2b6ce...b3ad219430)_

 No bugs found, your code is sparkling clean

<details>
<summary> Files analyzed, no issues (1)</summary>

  • `apps/backend/src/app/api/latest/internal/metrics/route.tsx`
</details>

[![Need help? Join our
Discord](https://img.shields.io/badge/Need%20help%3F%20Join%20our%20Discord-5865F2?style=plastic&logo=discord&logoColor=white)](https://discord.gg/n3SsVDAW6U)
<!-- RECURSEML_SUMMARY:END -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Corrected handling of anonymous users in analytics: records missing an
isAnonymous flag are now treated as non-anonymous when anonymous users
are excluded.
* Impacts country breakdown, daily active users, and recently active
metrics; overall total users unchanged.
* Expect slightly higher non-anonymous counts and more consistent
reporting across these metrics.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-09-09 19:22:02 -07:00
..
backend fix metrics queries (#880) 2025-09-09 19:22:02 -07:00
dashboard stepper ui fix (#881) 2025-09-09 19:21:48 -07:00
dev-launchpad Workflow queue 2025-09-03 13:31:40 -07:00
e2e oauth sign in scope and test (#887) 2025-09-09 19:21:28 -07:00
mock-oauth-server chore: update package versions 2025-09-03 01:38:13 -07:00
oauth-mock-server In-source unit tests (#429) 2025-02-14 11:47:52 -08:00