-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Conversation
Enhance Batch Processing by Reusing Existing Event Handling Logic
Fix duplicate key errors
…on to /api/* endpoints Signed-off-by: Louis Vallat <[email protected]>
add CORS headers to any value of COLLECT_API_ENDPOINT in addition to /api/* endpoints
Allow populating event's createdAt on the send endpoint
Fix journey report
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
There was a problem hiding this 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
andcypress/e2e/api.cy.ts
for user management operations - Added optional
createdAt
parameter insaveEvent
,saveEventData
, andsaveSessionData
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', () => { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
//let userId; |
}, | ||
body: userPost, | ||
}).then(response => { | ||
//userId = response.body.id; |
There was a problem hiding this comment.
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
//userId = response.body.id; |
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", |
There was a problem hiding this comment.
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.
"plugin:@typescript-eslint/eslint-recommended", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:@typescript-eslint/recommended", |
@@ -0,0 +1,65 @@ | |||
describe('Website tests', () => { |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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.
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, |
There was a problem hiding this comment.
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.
date_value: dataType === DATA_TYPE.date ? getUTCString(value) : null, | ||
created_at: createdAt, | ||
created_at: getUTCString(createdAt), |
There was a problem hiding this comment.
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.
const dnt = doNotTrack || ndnt || msdnt; | ||
return dnt === 1 || dnt === '1' || dnt === 'yes'; |
There was a problem hiding this comment.
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.
const dnt = doNotTrack || ndnt || msdnt; | ||
return dnt === 1 || dnt === '1' || dnt === 'yes'; |
There was a problem hiding this comment.
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.
const dnt = doNotTrack || ndnt || msdnt; | |
return dnt === 1 || dnt === '1' || dnt === 'yes'; | |
const dntValue = doNotTrack || ndnt || msdnt; | |
return dntValue === 1 || dntValue === '1' || dntValue === 'yes'; |
No description provided.