-
Notifications
You must be signed in to change notification settings - Fork 5.7k
logical warning of parsing int data type #3641
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
base: dev
Are you sure you want to change the base?
Conversation
Bumps [next](https://github.com/vercel/next.js) from 15.3.3 to 15.4.7. - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v15.3.3...v15.4.7) --- updated-dependencies: - dependency-name: next dependency-version: 15.4.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…tch-1 Add ISO country codes to constants
…/npm_and_yarn/next-15.4.7 Bump next from 15.3.3 to 15.4.7
`POST /api/websites/<id>`: Make name and domain optional in the validation schema
… to 'Asia/Kolkata' and updating validation schema to use normalized timezones.
feat (timezone): normalization function for handling legacy timezone identifiers
|
@Abhi9835004352 is attempting to deploy a commit to the umami-software Team on Vercel. A member of the Team first needs to authorize it. |
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.
Greptile Overview
Summary
This PR addresses TypeScript warnings related to string-to-number type conversions in Next.js App Router components and includes several related improvements. The main issue was that URL parameters arrive as strings but React components expect numeric types, particularly for pagination functionality.The core fix is in src/app/(main)/dashboard/DashboardPage.tsx where the page parameter is now properly converted from string to number using Number(page) || 1 before being passed to the Pager component. This prevents TypeScript warnings and ensures type safety.
Additionally, the PR includes timezone handling improvements by adding a normalization system in src/lib/date.ts that maps deprecated timezone names (like 'Asia/Calcutta') to their current equivalents ('Asia/Kolkata'). This normalization is integrated into the schema validation pipeline in src/lib/schema.ts using a transform step.
The PR also upgrades Next.js from version 15.3.3 to 15.4.7, which likely includes improvements to parameter handling and type definitions. Other changes include making website update fields optional in the API route, expanding country code mappings in constants, adding a focused test for shareId updates, and updating Docker configuration for local development.
These changes work together to improve type safety, timezone handling, and overall developer experience while maintaining backward compatibility.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| src/app/(main)/dashboard/DashboardPage.tsx | 5/5 | Fixes the core TypeScript warning by converting string page parameter to number |
| src/lib/date.ts | 5/5 | Adds timezone normalization to handle deprecated timezone names like 'Asia/Calcutta' |
| src/lib/schema.ts | 5/5 | Integrates timezone normalization into schema validation pipeline |
| package.json | 4/5 | Updates Next.js to version 15.4.7 to improve parameter handling and type definitions |
| src/app/api/websites/[websiteId]/route.ts | 4/5 | Makes name and domain fields optional in website update schema |
| src/lib/constants.ts | 4/5 | Significantly expands ISO country code mappings from ~70 to 240+ entries |
| cypress/e2e/api-website.cy.ts | 4/5 | Adds focused test case for website shareId-only updates |
| docker-compose.yml | 4/5 | Updates port mapping and APP_SECRET for local development configuration |
Confidence score: 4/5
- This PR addresses legitimate TypeScript warnings and includes well-implemented fixes with proper fallback handling
- Score reflects that while the core changes are solid, some modifications (like country mappings and Docker config) don't directly relate to the stated problem
- Pay close attention to the timezone normalization logic and ensure the country code mappings are complete and accurate
8 files reviewed, 1 comment
| 'Content-Type': 'application/json', | ||
| Authorization: Cypress.env('authorization'), | ||
| }, | ||
| body: { shareId: 'ABCDEF' }, |
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 shareId 'ABCDEF' is only 6 characters, but the SHARE_ID_REGEX requires 8-16 characters. This test will fail.
Prompt To Fix With AI
This is a comment left during a code review.
Path: cypress/e2e/api-website.cy.ts
Line: 160:160
Comment:
logic: The shareId 'ABCDEF' is only 6 characters, but the SHARE_ID_REGEX requires 8-16 characters. This test will fail.
How can I resolve this? If you propose a fix, please make it concise.
there was an issue where page component was giving an warning related to a where page was defined for int but params come in form of string so i parsed the string to int before giving it to the page function !!