ALL#69
Conversation
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
| import { useState, useMemo, useCallback, useEffect, use } from "react"; | |
| import { useState, useMemo, useCallback, useEffect } from "react"; |
| width={48} | ||
| height={48} |
There was a problem hiding this comment.
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.
| width={48} | |
| height={48} | |
| fill |
| 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 }, |
There was a problem hiding this comment.
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.
| 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 }, |
| 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 }, |
There was a problem hiding this comment.
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.
| 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 }, |
| @@ -83,7 +83,6 @@ export default function BrowsingPage() { | |||
| const { likeUser, isLiking } = useLikeUser(); | |||
There was a problem hiding this comment.
Unused variable isLiking.
| const { likeUser, isLiking } = useLikeUser(); | |
| const { likeUser } = useLikeUser(); |
| @@ -83,7 +83,6 @@ export default function BrowsingPage() { | |||
| const { likeUser, isLiking } = useLikeUser(); | |||
| const { passUser, isPassing } = usePassUser(); | |||
There was a problem hiding this comment.
Unused variable isPassing.
| const { passUser, isPassing } = usePassUser(); | |
| const { passUser } = usePassUser(); |
No description provided.