Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.17.0 #3294

Merged
merged 30 commits into from
Mar 8, 2025
Merged

v2.17.0 #3294

merged 30 commits into from
Mar 8, 2025

Conversation

mikecao
Copy link
Collaborator

@mikecao mikecao commented Mar 8, 2025

No description provided.

shrutesh1 and others added 30 commits February 20, 2025 11:11
Enhance Batch Processing by Reusing Existing Event Handling Logic
Fix duplicate key errors
add CORS headers to any value of COLLECT_API_ENDPOINT in addition to /api/* endpoints
Allow populating event's createdAt on the send endpoint
Copy link

vercel bot commented Mar 8, 2025

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

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

@mikecao mikecao merged commit 36c4645 into master Mar 8, 2025
11 checks passed
@mikecao mikecao deleted the analytics branch March 8, 2025 05:23
Copy link

@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 PR introduces significant updates for version 2.17.0, focusing on enhanced testing infrastructure and user management functionality.

  • Added comprehensive Cypress E2E tests in cypress/e2e/user.cy.ts and cypress/e2e/api.cy.ts for user management operations
  • Added optional createdAt parameter in saveEvent, saveEventData, and saveSessionData functions for better timestamp control
  • Added Do Not Track (DNT) support in src/tracker/index.js with browser detection and data-do-not-track attribute
  • Added data-test attributes across user management components for improved testability
  • Made password field optional in user updates and added UUID customization for user creation

Note: Some dependencies in package.json reference future versions (React 19, TypeScript 5.5.3) which could cause compatibility issues.

💡 (3/5) Reply to the bot's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

42 file(s) reviewed, 34 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -0,0 +1,29 @@
describe('Website tests', () => {
Copy link

Choose a reason for hiding this comment

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

logic: Test suite description 'Website tests' is incorrect for a user creation test

cy.login(Cypress.env('umami_user'), Cypress.env('umami_password'));
});

//let userId;
Copy link

Choose a reason for hiding this comment

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

style: Remove commented out code that is not being used

Suggested change
//let userId;

},
body: userPost,
}).then(response => {
//userId = response.body.id;
Copy link

Choose a reason for hiding this comment

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

style: Remove commented out code that is not being used

Suggested change
//userId = response.body.id;

Comment on lines +18 to 19
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
Copy link

Choose a reason for hiding this comment

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

style: Redundant inclusion of both eslint-recommended and recommended plugins. The typescript-eslint/recommended already includes eslint-recommended rules.

Suggested change
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended",

@@ -0,0 +1,65 @@
describe('Website tests', () => {
Copy link

Choose a reason for hiding this comment

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

logic: Test suite name 'Website tests' is incorrect - should be 'User tests' or 'User management tests' since it's testing user functionality

@@ -77,7 +79,7 @@ async function clickhouseQuery(data: {
string_value: getStringValue(value, dataType),
number_value: dataType === DATA_TYPE.number ? value : null,
date_value: dataType === DATA_TYPE.date ? getUTCString(value) : null,
created_at: createdAt,
created_at: getUTCString(createdAt),
Copy link

Choose a reason for hiding this comment

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

logic: createdAt is optional but no null check before passing to getUTCString. This could cause runtime errors if createdAt is undefined.

Suggested change
created_at: getUTCString(createdAt),
created_at: createdAt ? getUTCString(createdAt) : null,

@@ -42,6 +43,7 @@ async function relationalQuery(data: {
numberValue: a.dataType === DATA_TYPE.number ? a.value : null,
dateValue: a.dataType === DATA_TYPE.date ? new Date(a.value) : null,
Copy link

Choose a reason for hiding this comment

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

style: Potential invalid date creation - new Date(a.value) could return Invalid Date if a.value is malformed. Consider adding validation.

Comment on lines 100 to +101
date_value: dataType === DATA_TYPE.date ? getUTCString(value) : null,
created_at: createdAt,
created_at: getUTCString(createdAt),
Copy link

Choose a reason for hiding this comment

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

logic: No default value or null check for createdAt. If createdAt is undefined, getUTCString(undefined) could cause issues.

Comment on lines +52 to +53
const dnt = doNotTrack || ndnt || msdnt;
return dnt === 1 || dnt === '1' || dnt === 'yes';
Copy link

Choose a reason for hiding this comment

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

style: The hasDoNotTrack function should cache the DNT value since it's unlikely to change during a session. Currently it recalculates on every check.

Comment on lines +52 to +53
const dnt = doNotTrack || ndnt || msdnt;
return dnt === 1 || dnt === '1' || dnt === 'yes';
Copy link

Choose a reason for hiding this comment

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

logic: The dnt variable shadows the outer dnt constant from line 25. This could cause confusion and potential bugs.

Suggested change
const dnt = doNotTrack || ndnt || msdnt;
return dnt === 1 || dnt === '1' || dnt === 'yes';
const dntValue = doNotTrack || ndnt || msdnt;
return dntValue === 1 || dntValue === '1' || dntValue === 'yes';

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