Skip to content

Fix dependabot alerts & add canonical metadata to pages#18

Merged
aledefra merged 4 commits intomainfrom
develop
Jan 7, 2026
Merged

Fix dependabot alerts & add canonical metadata to pages#18
aledefra merged 4 commits intomainfrom
develop

Conversation

@wzrdx
Copy link
Collaborator

@wzrdx wzrdx commented Jan 7, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 qs library
  • 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 generateMetadata function

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 }) {
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
export async function generateMetadata({ params }) {
export async function generateMetadata({ params }: { params: Promise<{ nodeAddr: string }> }) {

Copilot uses AI. Check for mistakes.

export async function generateMetadata({ params }) {
const { licenseType, licenseId } = await params;
export async function generateMetadata({ params }) {
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
export async function generateMetadata({ params }) {
export async function generateMetadata({
params,
}: { params: Promise<{ licenseType: string; licenseId: string }> }) {

Copilot uses AI. Check for mistakes.
},
};
}
export async function generateMetadata({ params }) {
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
export async function generateMetadata({ params }) {
export async function generateMetadata({
params,
}: {
params: Promise<{ ownerEthAddr: string }>;
}) {

Copilot uses AI. Check for mistakes.
console.log(`[Node Page] Invalid node address: ${nodeAddr}`);
export async function generateMetadata({ params }) {
const { nodeAddr } = await params;
const canonical = `/node/${encodeURIComponent(nodeAddr)}`;
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
const { licenseType, licenseId } = await params;
export async function generateMetadata({ params }) {
const { licenseType, licenseId } = await params;
const canonical = `/license/${encodeURIComponent(licenseType)}/${encodeURIComponent(licenseId)}`;
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
}
export async function generateMetadata({ params }) {
const { ownerEthAddr } = await params;
const canonical = `/account/${encodeURIComponent(ownerEthAddr)}`;
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@aledefra aledefra merged commit 24374b5 into main Jan 7, 2026
1 check passed
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.

2 participants