Describe the Bug
The list on the Funnels page (and the Reports list in general — goals, journeys, etc.) is displayed in a non-deterministic order. The order appears random and changes over time (e.g. after editing a report), making it hard to locate a specific funnel.
Steps To Reproduce
- Create several funnel reports for a website.
- Open the Funnels page.
- Observe the order of the listed funnels — it does not follow creation date, update date, or name.
- Edit one of the funnels and reload — the position of items can change.
Expected Behavior
The list should have a stable, predictable order. Sorting alphabetically by name (name asc) by default would be the most intuitive, ideally with optional sort controls (name / created / updated).
Likely Root Cause
GET /api/reports (src/app/api/reports/route.ts) calls getReports, which delegates to prisma.pagedQuery('report', ...). The route only passes page, pageSize and search as filters — no orderBy.
In pagedQuery (src/lib/prisma.ts), the orderBy clause is only applied when orderBy is truthy. Since orderBy is undefined, Prisma's findMany runs without an ORDER BY. On PostgreSQL the row order is then undefined (roughly heap/physical order), which shifts after UPDATEs/VACUUM — hence the "random" appearance.
Suggested Fix
Apply a default ordering by name in getReports. Optionally, expose sort parameters in the API/UI so users can switch between name, created date, and updated date.
Database
PostgreSQL
Relevant log output
Which Umami version are you using?
3.1.0
How are you deploying your application?
Self-hosted (Docker)
Which browser are you using?
Chrome
Describe the Bug
The list on the Funnels page (and the Reports list in general — goals, journeys, etc.) is displayed in a non-deterministic order. The order appears random and changes over time (e.g. after editing a report), making it hard to locate a specific funnel.
Steps To Reproduce
Expected Behavior
The list should have a stable, predictable order. Sorting alphabetically by name (
name asc) by default would be the most intuitive, ideally with optional sort controls (name / created / updated).Likely Root Cause
GET /api/reports(src/app/api/reports/route.ts) callsgetReports, which delegates toprisma.pagedQuery('report', ...). The route only passespage,pageSizeandsearchas filters — noorderBy.In
pagedQuery(src/lib/prisma.ts), theorderByclause is only applied whenorderByis truthy. SinceorderByisundefined, Prisma'sfindManyruns without anORDER BY. On PostgreSQL the row order is then undefined (roughly heap/physical order), which shifts after UPDATEs/VACUUM — hence the "random" appearance.Suggested Fix
Apply a default ordering by name in
getReports. Optionally, expose sort parameters in the API/UI so users can switch between name, created date, and updated date.Database
PostgreSQL
Relevant log output
Which Umami version are you using?
3.1.0
How are you deploying your application?
Self-hosted (Docker)
Which browser are you using?
Chrome