-
Notifications
You must be signed in to change notification settings - Fork 0
fix: 서버 클라이언트 hydration 불일치 오류, 시간문제 해결 #376
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # 밸런스게임 태그 검색/필터 요청서 | ||
|
|
||
| ## 목적 | ||
|
|
||
| - 태그 필터를 드롭다운이 아닌 **검색 입력 + Enter 적용** 방식으로 변경. | ||
| - **다중 태그 필터** 지원 (입력 후 Enter로 태그 추가). | ||
| - 필터 적용 시 **입력된 모든 태그를 포함**하는 밸런스게임 목록만 반환. | ||
|
|
||
| ## 변경 요약 | ||
|
|
||
| - 프론트는 태그 입력 후 Enter 또는 "적용" 버튼 클릭 시 `tag` 쿼리로 요청 | ||
| - 입력 길이 제한: **최대 40자** | ||
| - 태그 필터 해제 시 `tag` 파라미터 제거 | ||
|
|
||
| ## API 요청 | ||
|
|
||
| ### GET /api/v1/balance-game | ||
|
|
||
| - 기존 목록 API 유지 | ||
| - Query Params: | ||
| - `page` (int, 1-based) | ||
| - `size` (int) | ||
| - `sort` (`latest` | `popular`) | ||
| - `status` (`active` | `closed`, optional) | ||
| - `tags` (string, optional) — `tag1,tag2,tag3` 형태의 comma-separated | ||
|
|
||
| ### 태그 필터 동작 | ||
|
|
||
| - `tags`가 전달되면 **모든 태그를 포함**한 투표만 반환 | ||
| - 대소문자/공백 처리 정책은 백엔드에서 일관되게 적용 | ||
| - `tags`가 비어있거나 누락되면 전체 반환 | ||
|
|
||
| ## 입력 제약 (프론트 기준) | ||
|
|
||
| - 태그 길이: 1~40자 | ||
| - 다중 태그 필터 지원 | ||
|
|
||
| ## 응답 | ||
|
|
||
| - 기존 밸런스게임 목록 응답 스키마 그대로 | ||
|
|
||
| ## 예시 | ||
|
|
||
| ``` | ||
| GET /api/v1/balance-game?page=1&size=10&sort=latest&status=active&tags=frontend,react | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import type { | ||
| AxiosError, | ||
| AxiosInstance, | ||
| InternalAxiosRequestConfig, | ||
| } from 'axios'; | ||
|
|
||
| const shouldLog = process.env.NODE_ENV !== 'production'; | ||
|
|
||
| const normalizeUrl = (config: InternalAxiosRequestConfig) => { | ||
| const base = config.baseURL ?? ''; | ||
| const url = config.url ?? ''; | ||
|
|
||
| if (!base) return url; | ||
| if (url.startsWith('http://') || url.startsWith('https://')) return url; | ||
|
|
||
| return `${base.replace(/\/$/, '')}/${url.replace(/^\//, '')}`; | ||
| }; | ||
|
|
||
| const stringifyParams = (params: InternalAxiosRequestConfig['params']) => { | ||
| if (!params) return ''; | ||
|
|
||
| try { | ||
| return JSON.stringify(params); | ||
| } catch { | ||
| return ''; | ||
| } | ||
| }; | ||
|
|
||
| const stringifyData = (data: unknown) => { | ||
| if (data === undefined) return ''; | ||
|
|
||
| if (typeof data === 'string') return data; | ||
|
|
||
| try { | ||
| return JSON.stringify(data); | ||
| } catch { | ||
| return String(data); | ||
| } | ||
| }; | ||
|
|
||
| export const attachApiLogger = (instance: AxiosInstance, label: string) => { | ||
| if (!shouldLog) return; | ||
|
|
||
| instance.interceptors.request.use((config) => { | ||
| const method = (config.method || 'get').toUpperCase(); | ||
| const url = normalizeUrl(config); | ||
| const params = stringifyParams(config.params); | ||
|
|
||
| console.log( | ||
| `[API ${label}] ${method} ${url}${params ? ` params=${params}` : ''}`, | ||
| ); | ||
|
|
||
| return config; | ||
| }); | ||
|
|
||
| instance.interceptors.response.use( | ||
| (response) => { | ||
| const method = (response.config.method || 'get').toUpperCase(); | ||
| const url = normalizeUrl(response.config); | ||
| const data = stringifyData(response.data); | ||
|
|
||
| console.log(`[API ${label}] ${method} ${url} -> ${response.status}`); | ||
| if (data) { | ||
| console.log(`[API ${label}] response=${data}`); | ||
| } | ||
|
|
||
| return response; | ||
| }, | ||
| (error: AxiosError) => { | ||
| const config = error.config; | ||
| const method = config?.method?.toUpperCase() || 'UNKNOWN'; | ||
| const url = config ? normalizeUrl(config) : 'unknown'; | ||
| const status = error.response?.status; | ||
| const data = stringifyData(error.response?.data); | ||
|
|
||
| console.log( | ||
| `[API ${label}] ${method} ${url} -> ERROR${status ? ` ${status}` : ''}`, | ||
| ); | ||
| if (data) { | ||
| console.log(`[API ${label}] response=${data}`); | ||
| } | ||
|
|
||
| return Promise.reject(error); | ||
| }, | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
응답/파라미터 로그에 민감정보 노출 위험
비프로덕션이라도 팀 공용 로그에 PII/토큰이 기록될 수 있습니다. 본문/파라미터 로그는 명시적 플래그로 제한하거나 마스킹을 권장합니다.
✅ 로그 본문 opt-in 예시
🤖 Prompt for AI Agents