Skip to content

ALL#69

Merged
YoungMame merged 1 commit into
mainfrom
fix-unboarding-data-validation-and-file-size
Jan 2, 2026
Merged

ALL#69
YoungMame merged 1 commit into
mainfrom
fix-unboarding-data-validation-and-file-size

Conversation

@YoungMame
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 2, 2026 15:30
@YoungMame YoungMame merged commit 443b321 into main Jan 2, 2026
3 checks passed
@YoungMame YoungMame deleted the fix-unboarding-data-validation-and-file-size branch January 2, 2026 15:30
Copy link
Copy Markdown

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 includes a collection of changes focused on improving code quality, fixing issues, and adjusting configuration. The changes span frontend (Next.js), backend (Fastify), and infrastructure (Nginx) components.

Key changes:

  • Increased Nginx file upload limit from 2M to 50M to support larger file uploads
  • Removed debug console.log statements from production code (mostly cleanup, with some new debug logs added)
  • Fixed error handling by properly re-throwing errors in the onboarding hook
  • Removed overly restrictive pattern validation on tags to support internationalization
  • Added image dimensions to ProfileCard component

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
nginx/nginx.conf Increased client_max_body_size from 2M to 50M for larger file uploads
nextjs/matcha/src/lib/api/userProfile.ts Removed debug console.log statement
nextjs/matcha/src/lib/api/browsing.ts Removed debug console.log statement
nextjs/matcha/src/hooks/useOnboarding.ts Added error re-throw for proper error propagation
nextjs/matcha/src/components/browsing/ProfileCard.tsx Added width/height props to Image component
nextjs/matcha/src/app/(logged)/browsing/page.tsx Added unused use import and removed a comment
fastify/assets/test/integration/fixtures/auth.fixtures.ts Removed debug console.log statement
fastify/assets/srcs/services/BrowsingService.ts Added blank line for formatting
fastify/assets/srcs/routes/private/user/me/profile.ts Removed pattern validation from tags to support special characters
fastify/assets/srcs/routes/private/user/me/completeProfile.ts Removed pattern validation from tags to support special characters
fastify/assets/srcs/controllers/private/browsing/index.ts Added debug console.log statements
Comments suppressed due to low confidence (7)

fastify/assets/srcs/services/BrowsingService.ts:1

  • Unused import PasswordManager.
import PasswordManager from "../utils/password";

fastify/assets/srcs/services/BrowsingService.ts:9

  • Unused imports ConflictError, ForbiddenError, InternalServerError, NotFoundError, UnauthorizedError.
import { UnauthorizedError, NotFoundError, BadRequestError, InternalServerError, ForbiddenError, ConflictError } from "../utils/error";

nextjs/matcha/src/app/(logged)/browsing/page.tsx:39

  • Unused variable permission.
		permission,

nextjs/matcha/src/lib/api/browsing.ts:2

  • Unused import generateMockProfilesWithMetadata.
import { generateMockProfilesWithMetadata } from '@/mocks/browsing_mocks';

nextjs/matcha/src/hooks/useOnboarding.ts:5

  • Unused import Fira_Sans_Extra_Condensed.
import { Fira_Sans_Extra_Condensed } from 'next/font/google';

fastify/assets/srcs/services/BrowsingService.ts:200

  • Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).
        })

fastify/assets/test/integration/fixtures/auth.fixtures.ts:70

  • Avoid automated semicolon insertion (95% of all statements in the enclosing function have an explicit semicolon).
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"use client";

import { useState, useMemo, useCallback, useEffect } from "react";
import { useState, useMemo, useCallback, useEffect, use } from "react";
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The use function is imported from React but is not used anywhere in this file. Unused imports should be removed to keep the code clean and avoid unnecessary bundle size increases.

Suggested change
import { useState, useMemo, useCallback, useEffect, use } from "react";
import { useState, useMemo, useCallback, useEffect } from "react";

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +28
width={48}
height={48}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The width and height values of 48px are likely incorrect for a profile card image. The parent container has aspect-3/4 which suggests a portrait aspect ratio, but these dimensions result in a square (48x48). This will cause the image to be stretched or distorted. Consider removing these fixed dimensions to let the image fill its container naturally, or use dimensions that match the 3:4 aspect ratio.

Suggested change
width={48}
height={48}
fill

Copilot uses AI. Check for mistakes.
email: { type: 'string', format: 'email' },
bio: { type: 'string', minLength: 50, maxLength: 500 },
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30, pattern: '[a-zA-Z_]' }, minItems: 3 },
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30 }, minItems: 3 },
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The pattern validation for tags has been removed, which now allows any characters including special characters, numbers, and spaces. While this enables internationalization (e.g., accented characters like "Café"), it may also allow potentially problematic input like SQL injection attempts or XSS payloads. Consider adding a more permissive but still secure pattern that allows alphanumeric characters, spaces, and common international characters while blocking potentially dangerous characters like quotes, brackets, or HTML tags.

Suggested change
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30 }, minItems: 3 },
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30, pattern: '^[^"\'<>[\\]{}()]*$' }, minItems: 3 },

Copilot uses AI. Check for mistakes.
lastName: { type: 'string', minLength: 1, maxLength: 50, pattern: '[a-zA-Z-\' ]' },
bio: { type: 'string', minLength: 50, maxLength: 500 },
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30, pattern: '[a-zA-Z_]' }, minItems: 3 },
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30 }, minItems: 3 },
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The pattern validation for tags has been removed, which now allows any characters including special characters, numbers, and spaces. While this enables internationalization (e.g., accented characters like "Café"), it may also allow potentially problematic input like SQL injection attempts or XSS payloads. Consider adding a more permissive but still secure pattern that allows alphanumeric characters, spaces, and common international characters while blocking potentially dangerous characters like quotes, brackets, or HTML tags.

Suggested change
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30 }, minItems: 3 },
tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30, pattern: "^[\\p{L}\\p{N} _-]+$" }, minItems: 3 },

Copilot uses AI. Check for mistakes.
@@ -83,7 +83,6 @@ export default function BrowsingPage() {
const { likeUser, isLiking } = useLikeUser();
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Unused variable isLiking.

Suggested change
const { likeUser, isLiking } = useLikeUser();
const { likeUser } = useLikeUser();

Copilot uses AI. Check for mistakes.
@@ -83,7 +83,6 @@ export default function BrowsingPage() {
const { likeUser, isLiking } = useLikeUser();
const { passUser, isPassing } = usePassUser();
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Unused variable isPassing.

Suggested change
const { passUser, isPassing } = usePassUser();
const { passUser } = usePassUser();

Copilot uses AI. Check for mistakes.
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