Skip to content

v2.16#3242

Merged
mikecao merged 165 commits intomasterfrom
analytics
Feb 21, 2025
Merged

v2.16#3242
mikecao merged 165 commits intomasterfrom
analytics

Conversation

@mikecao
Copy link
Member

@mikecao mikecao commented Feb 21, 2025

No description provided.

franciscao633 and others added 30 commits October 21, 2024 12:36
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](ai/nanoid@3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…nanoid-3.3.8

Bump nanoid from 3.3.7 to 3.3.8
chore(translation): update Persian (fa) translation and fix all issues
@vercel
Copy link

vercel bot commented Feb 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umami-analytics-eu ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 4:41am
umami-analytics-us ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 4:41am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
umami ⬜️ Ignored (Inspect) Feb 21, 2025 4:41am
umami-mysql ⬜️ Ignored (Inspect) Feb 21, 2025 4:41am
umami-postgresql ⬜️ Ignored (Inspect) Feb 21, 2025 4:41am

@mikecao mikecao merged commit b6e5438 into master Feb 21, 2025
9 checks passed
@mikecao mikecao deleted the analytics branch February 21, 2025 04:44
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This version bump (v2.16.0) introduces significant architectural and dependency updates to the Umami analytics platform. Here are the key changes:

  • Migrates API routes from Next.js Pages Router to App Router, moving all endpoints from /pages/api to /app/api with improved request handling and validation using Zod
  • Updates Node.js to version 22-alpine in Dockerfile and upgrades Prisma to 6.1.0, with changes to binary targets and database schema
  • Implements new authentication system using bcryptjs and JWT tokens, with Redis integration for session management
  • Adds new channel analytics functionality with domain grouping and traffic source categorization
  • Introduces proper CORS configuration with configurable max age and standardizes import paths using '@/' alias prefix across the codebase

The changes represent a significant modernization of the codebase with improved type safety and security measures.

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

468 file(s) reviewed, 166 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -9,7 +9,7 @@ RUN yarn config set network-timeout 300000
RUN yarn install --frozen-lockfile
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider adding yarn cache cleanup after install to reduce image size

Comment on lines 178 to 180
typescript: {
ignoreBuildErrors: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Ignoring TypeScript build errors in production could mask critical type issues. Consider enabling strict mode or handling errors properly.

Comment on lines +25 to +27
if (config.uiDisabled) {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: New check added to prevent rendering when UI is disabled, but no fallback UI provided for disabled state

return null;
}

export default async function ({ children }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Function is now marked async but doesn't use any await operations internally - verify if async is actually needed

import { REPORT_TYPES } from '@/lib/constants';
import ReportDeleteButton from './ReportDeleteButton';

export function ReportsTable({ data = [], showDomain }: { data: any[]; showDomain?: boolean }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: data parameter uses 'any[]' type which bypasses TypeScript type checking. Consider defining a proper Report interface type.

: ''
}
order by created_at desc
limit 1000)
select * from events
`,
{ ...params, query: `%${query}%` },
{ ...params, query: `%${search}%` },
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Parameter name mismatch - using 'query' in binding but 'search' in the SQL. This will cause the search functionality to fail for relational databases.

Suggested change
{ ...params, query: `%${search}%` },
{ ...params, search: `%${search}%` },

Comment on lines +34 to +37
async function clickhouseQuery(
websiteId: string,
filters: QueryFilters,
): Promise<{ x: string; y: number }[]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Return type for clickhouseQuery doesn't match the actual query results. The query returns {domain, query, visitors} but the type annotation expects {x, y}

Suggested change
async function clickhouseQuery(
websiteId: string,
filters: QueryFilters,
): Promise<{ x: string; y: number }[]> {
async function clickhouseQuery(
websiteId: string,
filters: QueryFilters,
): Promise<{ domain: string; query: string; visitors: number }[]> {

});
}

async function relationalQuery(websiteId: string, filters: QueryFilters) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Missing return type annotation for relationalQuery function. Should match clickhouseQuery's return type for consistency

Suggested change
async function relationalQuery(websiteId: string, filters: QueryFilters) {
async function relationalQuery(websiteId: string, filters: QueryFilters): Promise<{ domain: string; query: string; visitors: number }[]> {

@@ -32,7 +32,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
where website_event.website_id = {{websiteId::uuid}}
${filterQuery}
${dateQuery}
order by website_event.created_at asc
order by website_event.created_at desc
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The sort order was changed from 'asc' to 'desc' here, but remains 'asc' in the clickhouse query. This inconsistency will cause different ordering between database implementations.

Suggested change
order by website_event.created_at desc
order by website_event.created_at asc

count(distinct d.session_id) as "total"
from website_event e
join session_data d
on d.session_id = e.session_id
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: join condition should include website_id to prevent cross-website data leakage

Suggested change
on d.session_id = e.session_id
on d.session_id = e.session_id and d.website_id = e.website_id

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.

8 participants