Skip to content

Fix dev app metrics#704

Merged
rickyrombo merged 1 commit intomainfrom
mjp-fix-dev-app-metrics
Mar 9, 2026
Merged

Fix dev app metrics#704
rickyrombo merged 1 commit intomainfrom
mjp-fix-dev-app-metrics

Conversation

@rickyrombo
Copy link
Contributor

Can't group by redirect_urls as they're json agged and can't be equality compared. do a lateral join to get stats instead

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the developer apps “include=metrics” endpoint query by removing an invalid GROUP BY on JSON-aggregated redirect URIs, and instead computing metrics via a correlated lateral subquery per app.

Changes:

  • Replaced the direct api_metrics_apps join + SUM(...) aggregates with a LEFT JOIN LATERAL metrics subquery.
  • Removed the GROUP BY clause that required grouping on oau.redirect_uris (JSON), which cannot be equality-compared in Postgres.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rickyrombo rickyrombo merged commit c45a624 into main Mar 9, 2026
8 checks passed
@rickyrombo rickyrombo deleted the mjp-fix-dev-app-metrics branch March 9, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants