Conversation
There was a problem hiding this comment.
Pull request overview
This pull request addresses Dependabot security alerts by updating various npm dependencies and adds canonical metadata to pages for improved SEO.
Key Changes:
- Updates Next.js from 15.4.7 to 15.5.9, React from 19.1.0 to 19.2.1, and other dependencies including ESLint-related packages and the
qslibrary - Adds canonical URL metadata to all major pages (stats, search, home, node, license, account, node-operators, licenses, cloud-service-providers)
- Refactors error metadata objects to be defined locally within each
generateMetadatafunction
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates core dependencies including Next.js, React, React types, and qs to address security vulnerabilities |
| package-lock.json | Lock file updates corresponding to package.json changes, including transitive dependency updates for ESLint and related tools |
| app/stats/page.tsx | Adds canonical URL metadata pointing to '/stats' |
| app/search/page.tsx | Adds new generateMetadata function with canonical URL that includes query parameter when present |
| app/page.tsx | Adds generateMetadata function with canonical URL that includes page parameter when greater than 1 |
| app/node/[nodeAddr]/page.tsx | Moves error metadata definition inside generateMetadata and adds canonical URL for node pages |
| app/node-operators/page.tsx | Enhances generateMetadata to accept searchParams and adds canonical URL with optional page parameter |
| app/licenses/page.tsx | Enhances generateMetadata to accept searchParams and adds canonical URL with optional page parameter |
| app/license/[licenseType]/[licenseId]/page.tsx | Moves error metadata definition inside generateMetadata and adds canonical URL for license pages |
| app/cloud-service-providers/page.tsx | Enhances generateMetadata to accept searchParams and adds canonical URL with optional page parameter |
| app/account/[ownerEthAddr]/page.tsx | Refactors error metadata to be defined locally and adds canonical URL for account pages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if (!resolvedNodeEthAddr) { | ||
| console.log(`[Node Page] Invalid node address: ${nodeAddr}`); | ||
| export async function generateMetadata({ params }) { |
There was a problem hiding this comment.
The params parameter is missing type annotations. According to Next.js best practices, this should be typed. Consider adding a type annotation like { params: Promise<{ nodeAddr: string }> } to improve type safety and catch potential errors at compile time.
| export async function generateMetadata({ params }) { | |
| export async function generateMetadata({ params }: { params: Promise<{ nodeAddr: string }> }) { |
|
|
||
| export async function generateMetadata({ params }) { | ||
| const { licenseType, licenseId } = await params; | ||
| export async function generateMetadata({ params }) { |
There was a problem hiding this comment.
The params parameter is missing type annotations. According to Next.js best practices, this should be typed. Consider adding a type annotation like { params: Promise<{ licenseType: string; licenseId: string }> } to improve type safety and catch potential errors at compile time.
| export async function generateMetadata({ params }) { | |
| export async function generateMetadata({ | |
| params, | |
| }: { params: Promise<{ licenseType: string; licenseId: string }> }) { |
| }, | ||
| }; | ||
| } | ||
| export async function generateMetadata({ params }) { |
There was a problem hiding this comment.
The params parameter is missing type annotations. According to Next.js best practices, this should be typed. Consider adding a type annotation like { params: Promise<{ ownerEthAddr: string }> } to improve type safety and catch potential errors at compile time.
| export async function generateMetadata({ params }) { | |
| export async function generateMetadata({ | |
| params, | |
| }: { | |
| params: Promise<{ ownerEthAddr: string }>; | |
| }) { |
app/node/[nodeAddr]/page.tsx
Outdated
| console.log(`[Node Page] Invalid node address: ${nodeAddr}`); | ||
| export async function generateMetadata({ params }) { | ||
| const { nodeAddr } = await params; | ||
| const canonical = `/node/${encodeURIComponent(nodeAddr)}`; |
There was a problem hiding this comment.
The canonical URL is constructed with nodeAddr before validating whether it's a valid address. If nodeAddr is undefined or contains invalid characters, this could produce an incorrect canonical URL like '/node/undefined'. Consider constructing the canonical URL after validation or within the success case only, to ensure canonical URLs point to valid resources.
| const { licenseType, licenseId } = await params; | ||
| export async function generateMetadata({ params }) { | ||
| const { licenseType, licenseId } = await params; | ||
| const canonical = `/license/${encodeURIComponent(licenseType)}/${encodeURIComponent(licenseId)}`; |
There was a problem hiding this comment.
The canonical URL is constructed with licenseType and licenseId before validation. If these parameters are invalid (e.g., licenseType is not in the allowed list or licenseId is out of range), the canonical URL will still point to the invalid path. Consider constructing the canonical URL only after validation to ensure canonical URLs only point to valid resources.
app/account/[ownerEthAddr]/page.tsx
Outdated
| } | ||
| export async function generateMetadata({ params }) { | ||
| const { ownerEthAddr } = await params; | ||
| const canonical = `/account/${encodeURIComponent(ownerEthAddr)}`; |
There was a problem hiding this comment.
The canonical URL is constructed with ownerEthAddr before validation. If the address is invalid (not an address or is a zero address), the canonical URL will still point to the invalid path. Consider constructing the canonical URL only after validation or within the success case to ensure canonical URLs only point to valid resources.
…, license, and node pages
No description provided.