Skip to content

버전 2.1.0#144

Merged
GulSam00 merged 26 commits into
mainfrom
develop
Feb 8, 2026
Merged

버전 2.1.0#144
GulSam00 merged 26 commits into
mainfrom
develop

Conversation

@GulSam00
Copy link
Copy Markdown
Owner

@GulSam00 GulSam00 commented Feb 8, 2026

📌 PR 제목

[Type] : 작업 내용 요약

📌 변경 사항

💬 추가 참고 사항

GulSam00 and others added 26 commits February 4, 2026 02:16
Updated the README to clarify features and services offered by Singcode, including song list management and new attendance check and song recommendation features.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
singcode Ready Ready Preview, Comment Feb 8, 2026 2:38pm

@GulSam00 GulSam00 added this to the 버전 2.1.0 milestone Feb 8, 2026
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Version 2.1.0 - Guest tosing feature and footer animations

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Guest users can now add songs to "tosing" list without authentication
• Footer navigation includes animated highlight effects on user interactions
• Added guest data persistence using localStorage for tosing functionality
• Improved query management with conditional authentication checks
• Added issue templates and development documentation
Diagram
flowchart LR
  A["Guest User"] -->|"Add Song"| B["useGuestToSingStore"]
  B -->|"Persist to localStorage"| C["Local Storage"]
  C -->|"Retrieve on Load"| D["ToSing Page"]
  E["User Action"] -->|"Trigger"| F["useFooterAnimateStore"]
  F -->|"Set Animation Key"| G["Footer Component"]
  G -->|"Framer Motion"| H["Animated Highlight"]
Loading

Grey Divider

File Changes

1. apps/web/src/app/api/songs/tosing/guest/route.ts ✨ Enhancement +56/-0

New API endpoint for guest tosing songs

apps/web/src/app/api/songs/tosing/guest/route.ts


2. apps/web/src/stores/useGuestToSingStore.ts ✨ Enhancement +67/-0

Guest tosing state management with localStorage

apps/web/src/stores/useGuestToSingStore.ts


3. apps/web/src/stores/useFooterAnimateStore.ts ✨ Enhancement +36/-0

Footer animation state management store

apps/web/src/stores/useFooterAnimateStore.ts


View more (42)
4. apps/web/src/hooks/useSearchSong.ts ✨ Enhancement +26/-4

Guest tosing support in search functionality

apps/web/src/hooks/useSearchSong.ts


5. apps/web/src/hooks/useToSingSong.ts ✨ Enhancement +36/-2

Guest tosing operations and drag-drop support

apps/web/src/hooks/useToSingSong.ts


6. apps/web/src/Footer.tsx ✨ Enhancement +46/-14

Framer motion animations for footer navigation

apps/web/src/Footer.tsx


7. apps/web/src/lib/api/tosing.ts ✨ Enhancement +7/-0

Guest tosing API client function

apps/web/src/lib/api/tosing.ts


8. apps/web/src/queries/tosingSongQuery.ts ✨ Enhancement +29/-50

Conditional query logic for guest vs authenticated

apps/web/src/queries/tosingSongQuery.ts


9. apps/web/src/queries/likeSongQuery.ts ✨ Enhancement +2/-3

Authentication-based query enabling

apps/web/src/queries/likeSongQuery.ts


10. apps/web/src/queries/saveSongQuery.ts ✨ Enhancement +2/-3

Authentication-based query enabling

apps/web/src/queries/saveSongQuery.ts


11. apps/web/src/queries/songThumbQuery.ts ✨ Enhancement +3/-2

Cache strategy adjustment for fresh data

apps/web/src/queries/songThumbQuery.ts


12. apps/web/src/queries/searchSongQuery.ts 🐞 Bug fix +0/-3

Removed redundant query invalidations

apps/web/src/queries/searchSongQuery.ts


13. apps/web/src/types/apiRoute.ts ✨ Enhancement +13/-4

Conditional type for API responses

apps/web/src/types/apiRoute.ts


14. apps/web/src/app/search/HomePage.tsx ✨ Enhancement +27/-8

Guest tosing state integration in search

apps/web/src/app/search/HomePage.tsx


15. apps/web/src/app/search/SearchResultCard.tsx ✨ Enhancement +7/-1

Props refactoring for tosing state

apps/web/src/app/search/SearchResultCard.tsx


16. apps/web/src/app/tosing/page.tsx ✨ Enhancement +2/-20

Component extraction for add song button

apps/web/src/app/tosing/page.tsx


17. apps/web/src/app/tosing/AddSongButton.tsx ✨ Enhancement +29/-0

New extracted button component

apps/web/src/app/tosing/AddSongButton.tsx


18. apps/web/src/app/tosing/AddListModal.tsx ✨ Enhancement +6/-2

Authentication-based query integration

apps/web/src/app/tosing/AddListModal.tsx


19. apps/web/src/app/popular/page.tsx ✨ Enhancement +1/-12

Refactored to use query hook directly

apps/web/src/app/popular/page.tsx


20. apps/web/src/app/popular/PopularRankingList.tsx ✨ Enhancement +20/-11

Client-side rendering with refresh functionality

apps/web/src/app/popular/PopularRankingList.tsx


21. apps/web/src/auth.tsx ✨ Enhancement +9/-1

Added tosing to allowed guest paths

apps/web/src/auth.tsx


22. apps/web/src/components/ThumbUpModal.tsx ✨ Enhancement +6/-1

Footer animation trigger on recommendation

apps/web/src/components/ThumbUpModal.tsx


23. apps/web/src/components/ui/IntervalProgress.tsx ✨ Enhancement +126/-0

New progress timer component

apps/web/src/components/ui/IntervalProgress.tsx


24. apps/web/src/query.tsx ✨ Enhancement +7/-1

React Query DevTools integration

apps/web/src/query.tsx


25. apps/web/package.json Dependencies +3/-2

Version bump and dependency updates

apps/web/package.json


26. apps/web/public/changelog.json 📝 Documentation +7/-0

Version 2.1.0 changelog entry

apps/web/public/changelog.json


27. README.md 📝 Documentation +26/-23

Updated features and removed screenshots

README.md


28. .github/ISSUE_TEMPLATE/bug_report.md 📝 Documentation +30/-0

New bug report issue template

.github/ISSUE_TEMPLATE/bug_report.md


29. .github/ISSUE_TEMPLATE/feature_request.md 📝 Documentation +21/-0

New feature request issue template

.github/ISSUE_TEMPLATE/feature_request.md


30. .github/ISSUE_TEMPLATE/refactor.md 📝 Documentation +27/-0

New refactoring issue template

.github/ISSUE_TEMPLATE/refactor.md


31. .github/ISSUE_TEMPLATE/config.yml 📝 Documentation +5/-0

Issue template configuration

.github/ISSUE_TEMPLATE/config.yml


32. GEMINI.md 📝 Documentation +7/-0

Added custom Git automation rules

GEMINI.md


33. .github/copilot_instructions.md Additional files +0/-0

...

.github/copilot_instructions.md


34. .github/temp/gpt-review.yml Additional files +0/-28

...

.github/temp/gpt-review.yml


35. .github/temp/update-ky-youtube.yml Additional files +0/-63

...

.github/temp/update-ky-youtube.yml


36. .github/workflows/crawl_recent_tj.yml Additional files +0/-0

...

.github/workflows/crawl_recent_tj.yml


37. .github/workflows/update_ky_youtube.yml Additional files +0/-0

...

.github/workflows/update_ky_youtube.yml


38. .vscode/settings.json Additional files +0/-7

...

.vscode/settings.json


39. apps/web/public/sitemap-0.xml Additional files +1/-1

...

apps/web/public/sitemap-0.xml


40. apps/web/src/app/info/like/page.tsx Additional files +3/-1

...

apps/web/src/app/info/like/page.tsx


41. apps/web/src/app/info/save/page.tsx Additional files +6/-3

...

apps/web/src/app/info/save/page.tsx


42. apps/web/src/app/tosing/SongList.tsx Additional files +2/-2

...

apps/web/src/app/tosing/SongList.tsx


43. apps/web/src/components/LoadingOverlay.tsx Additional files +0/-24

...

apps/web/src/components/LoadingOverlay.tsx


44. apps/web/src/components/StaticLoading.tsx Additional files +0/-1

...

apps/web/src/components/StaticLoading.tsx


45. pnpm-lock.yaml Additional files +17/-14

...

pnpm-lock.yaml


Grey Divider

Qodo Logo

@GulSam00 GulSam00 merged commit 392d1dd into main Feb 8, 2026
1 check passed
@qodo-code-review
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (5) 📎 Requirement gaps (0)

Grey Divider


Action required

1. API returns error.message 📘 Rule violation ⛨ Security
Description
/api/songs/tosing/guest에서 Supabase 오류의 error.message를 그대로 응답으로 반환하고 있습니다.
• DB/내부 구현 관련 오류 메시지가 사용자에게 노출될 수 있어, 공격자에게 시스템 정보를 제공할 위험이 있습니다.
• 사용자-facing 응답은 일반화하고, 상세 오류는 내부 로그로만 남겨야 합니다.
Code

apps/web/src/app/api/songs/tosing/guest/route.ts[R23-30]

+    if (error) {
+      return NextResponse.json(
+        {
+          success: false,
+          error: error?.message || 'Unknown error',
+        },
+        { status: 500 },
+      );
Evidence
컴플라이언스는 사용자에게 내부 오류 상세(예: DB 오류 메시지)를 노출하지 말 것을 요구합니다. 해당 라우트는 Supabase의 error.message를 그대로
error 필드로 반환합니다.

Rule 4: Generic: Secure Error Handling
apps/web/src/app/api/songs/tosing/guest/route.ts[23-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`/api/songs/tosing/guest`가 Supabase의 `error.message`를 그대로 사용자에게 반환하여 내부 정보가 노출될 수 있습니다.

## Issue Context
컴플라이언스(secure error handling)는 사용자-facing 오류 응답에 내부 구현/DB 상세를 포함하지 말 것을 요구합니다.

## Fix Focus Areas
- apps/web/src/app/api/songs/tosing/guest/route.ts[23-30]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. alert(error.message) used 📘 Rule violation ⛨ Security
Description
• 여러 React Query mutation 에러 처리에서 alert(error.message)로 내부 오류 메시지를 사용자에게 직접 노출하고 있습니다.
• 네트워크/서버/DB 관련 상세 메시지가 그대로 표시될 수 있어 보안상 위험하며, 사용자 경험도 저해됩니다.
• 사용자-facing 메시지는 일반화하고, 디버깅용 상세는 내부 로그로 분리해야 합니다.
Code

apps/web/src/queries/tosingSongQuery.ts[R44-47]

    onError: error => {
Evidence
컴플라이언스는 스택트레이스/DB 오류 등 내부 시스템 정보를 사용자에게 노출하지 말 것을 요구합니다. 현재 코드가 error.message를 그대로 alert()로
표시합니다(다른 mutation에도 동일 패턴 존재).

Rule 4: Generic: Secure Error Handling
apps/web/src/queries/tosingSongQuery.ts[44-47]
apps/web/src/queries/songThumbQuery.ts[28-31]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
mutation 실패 시 `alert(error.message)`로 내부 오류 상세가 사용자에게 노출됩니다.

## Issue Context
secure error handling 요구사항에 따라 사용자-facing 오류는 일반화하고, 상세는 내부 로그로만 남겨야 합니다.

## Fix Focus Areas
- apps/web/src/queries/tosingSongQuery.ts[44-47]
- apps/web/src/queries/songThumbQuery.ts[28-31]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. songIds[] not validated 📘 Rule violation ⛨ Security
Description
• 외부 입력인 쿼리 파라미터 songIds[]를 형식/길이/개수 제한 없이 그대로 DB 조회에 사용하고 있습니다.
• 비정상적으로 많은 ID 요청(DoS성)이나 잘못된 형식 입력으로 인한 예외/성능 저하를 유발할 수 있습니다.
• ID 형식(예: UUID) 검증과 최대 개수 제한, 빈 값/중복 처리 등을 추가해야 합니다.
Code

apps/web/src/app/api/songs/tosing/guest/route.ts[R9-21]

+    const searchParams = request.nextUrl.searchParams;
+    const ids = searchParams.getAll('songIds[]');
+
+    if (!ids || ids.length === 0) {
+      return NextResponse.json({ success: true, data: [] });
+    }
+
+    const supabase = await createClient();
+
+    const { data, error } = await supabase
+      .from('songs')
+      .select('*', { count: 'exact' })
+      .in('id', ids);
Evidence
컴플라이언스는 모든 외부 입력에 대해 검증/정제를 요구합니다. 현재 songIds[]를 그대로 받아 .in('id', ids)에 전달하며, 형식/개수 제한 로직이 없습니다.

Rule 6: Generic: Security-First Input Validation and Data Handling
apps/web/src/app/api/songs/tosing/guest/route.ts[9-21]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`songIds[]`가 검증 없이 DB 조회에 사용되어 악성/비정상 입력에 취약합니다.

## Issue Context
security-first input validation 요구사항에 따라 외부 입력은 검증/정제되어야 합니다.

## Fix Focus Areas
- apps/web/src/app/api/songs/tosing/guest/route.ts[9-21]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
4. setQueryData returns undefined 📘 Rule violation ⛯ Reliability
Description
useDeleteToSingSongMutation().onMutate에서 setQueryData 콜백이 old.filter(...) 결과를 return하지 않아
  캐시가 undefined로 설정될 수 있습니다.
• 이후 렌더/로직에서 배열을 기대하면 런타임 오류로 이어져, 실패 지점에 대한 방어가 부족합니다.
• 필터 결과를 반환하고, oldundefined/빈 배열인 케이스도 안전하게 처리해야 합니다.
Code

apps/web/src/queries/tosingSongQuery.ts[R60-62]

+      queryClient.setQueryData(['toSingSong'], (old: ToSingSong[]) => {
+        old.filter(song => song.songs.id !== songId);
+      });
Evidence
컴플라이언스는 잠재적 실패 지점을 식별하고(예: undefined 상태) 안정적으로 처리할 것을 요구합니다. 현재 콜백이 값을 반환하지 않아 캐시가 예상치 못한 상태가 될 수
있습니다.

Rule 3: Generic: Robust Error Handling and Edge Case Management
apps/web/src/queries/tosingSongQuery.ts[60-62]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`setQueryData` 콜백이 값을 반환하지 않아 캐시가 `undefined`가 될 수 있습니다.

## Issue Context
robust error handling 요구사항에 따라 예외/엣지 케이스(예: undefined 데이터)를 방어하고, 상태 업데이트는 항상 일관된 타입을 유지해야 합니다.

## Fix Focus Areas
- apps/web/src/queries/tosingSongQuery.ts[57-63]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

5. Raw errors logged 📘 Rule violation ⛨ Security
Description
• 서버 라우트에서 console.error(..., error)로 에러 객체 전체를 비정형 로그로 출력하고 있습니다.
• 에러 객체에 요청 컨텍스트/토큰/쿼리 정보 등이 포함될 경우 로그를 통해 민감 정보가 유출될 수 있습니다.
• 구조화된 로깅과 민감정보 마스킹/필터링을 적용해야 합니다.
Code

apps/web/src/app/api/songs/tosing/guest/route.ts[50]

+    console.error('Error in tosing API:', error);
Evidence
컴플라이언스는 로그에 민감정보가 포함되지 않고, 감사/모니터링을 위해 구조화된 형태를 권장합니다. 현재는 원본 에러 객체를 그대로 console.error로 출력합니다.

Rule 5: Generic: Secure Logging Practices
apps/web/src/app/api/songs/tosing/guest/route.ts[50-50]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
서버에서 원본 에러 객체를 그대로 로그로 남겨 민감 정보가 로그에 포함될 위험이 있습니다.

## Issue Context
secure logging practices 요구사항에 따라 로그는 구조화되고 민감정보가 없어야 합니다.

## Fix Focus Areas
- apps/web/src/app/api/songs/tosing/guest/route.ts[50-50]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Guest sees cached private songs 🐞 Bug ⛨ Security
Description
/tosing가 public path로 허용되면서(게스트 접근 가능) AddListModal이 좋아요/재생목록 데이터를 그대로 렌더링합니다.
• useLikeSongQuery/useSaveSongQueryqueryKey가 고정이고 enabledisAuthenticated로 제어하며, 로그아웃 시
  Query 캐시를 비우지 않기 때문에 같은 세션에서 로그아웃 후에도 이전 사용자 데이터가 UI에 남아 노출될 가능성이 있습니다.
Code

apps/web/src/queries/likeSongQuery.ts[R7-10]

+export function useLikeSongQuery(isAuthenticated: boolean) {
  return useQuery({
    queryKey: ['likeSong'],
    queryFn: async () => {
Evidence
/tosing는 인증이 없어도 렌더링되는 경로이며, 해당 화면의 모달이 likeSong/saveSongFolder 쿼리를 사용해 목록을 렌더링합니다. 그런데 두 쿼리는
사용자/인증 컨텍스트가 queryKey에 포함되지 않고, 로그아웃에서도 쿼리 캐시를 제거하지 않아(메모리에 남아) 비인증 상태에서 이전 캐시 데이터가 그대로 사용될 소지가
있습니다.

apps/web/src/auth.tsx[8-16]
apps/web/src/app/tosing/AddListModal.tsx[36-43]
apps/web/src/app/tosing/AddListModal.tsx[70-88]
apps/web/src/queries/likeSongQuery.ts[7-18]
apps/web/src/queries/saveSongQuery.ts[6-34]
apps/web/src/stores/useAuthStore.ts[125-134]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`/tosing`가 게스트에게 공개된 상태에서, 좋아요/재생목록 쿼리가 고정 queryKey를 사용하고 로그아웃 시 캐시를 비우지 않아 같은 세션 내에서 이전 사용자 데이터가 잔류/노출될 소지가 있습니다.

### Issue Context
- `/tosing`는 public path
- `AddListModal`이 좋아요/재생목록 쿼리 결과를 그대로 렌더링
- `enabled: isAuthenticated`는 fetch만 막고, 캐시 자체를 ‘삭제’하지는 않습니다(캐시 잔류 가능)

### Fix Focus Areas
- apps/web/src/queries/likeSongQuery.ts[7-18]
- apps/web/src/queries/saveSongQuery.ts[6-35]
- apps/web/src/stores/useAuthStore.ts[125-134]
- apps/web/src/app/tosing/AddListModal.tsx[36-43]
- apps/web/src/auth.tsx[8-16]

### Suggested approaches
1) **queryKey를 사용자 단위로 분리**
- 예: `['likeSong', userId]`, `['saveSongFolder', userId]`
- `enabled: isAuthenticated && !!userId`

2) **로그아웃 시 쿼리 캐시 제거**
- AuthProvider 또는 QueryProvider 레벨에서 `isAuthenticated` 변화 감지 후
 - `queryClient.removeQueries({ queryKey: ['likeSong'] })`
 - `queryClient.removeQueries({ queryKey: ['saveSongFolder'] })`
 - 필요 시 `queryClient.clear()`

3) **게스트 UX 방어**
- `!isAuthenticated`일 때 AddListModal에서 ‘좋아요/재생목록’ 탭 숨김 또는 빈 상태 강제

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Broken Discussions link 🐞 Bug ✓ Correctness
Description
.github/ISSUE_TEMPLATE/config.yml의 Discussions URL이 https://github.com/사용자명/리포지토리명/discussions
  플레이스홀더로 남아 있어 실제 리포지토리에서 동작하지 않습니다.
• 이슈 생성 UI에서 잘못된 링크를 노출하여 사용자 문의/토론 유입이 끊길 수 있습니다.
Code

.github/ISSUE_TEMPLATE/config.yml[R3-5]

+  - name: 💬 질문 및 토론 (Discussions)
+    url: https://github.com/사용자명/리포지토리명/discussions
+    about: 버그나 기능 요청이 아닌 일반적인 질문은 여기서 해주세요.
Evidence
config.yml에 실제 리포 URL이 아닌 플레이스홀더 문자열이 들어 있어, GitHub UI에서 노출되는 contact link가 깨집니다.

.github/ISSUE_TEMPLATE/config.yml[1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
GitHub Issue Template config의 Discussions 링크가 플레이스홀더로 남아 있어 실제 환경에서 깨진 링크가 노출됩니다.

### Issue Context
이 링크는 GitHub에서 ‘새 이슈 생성’ 화면의 contact link로 사용자에게 직접 노출됩니다.

### Fix Focus Areas
- .github/ISSUE_TEMPLATE/config.yml[1-5]

### Suggested change
- `https://github.com/<owner>/<repo>/discussions` 형태로 실제 값으로 교체

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +23 to +30
if (error) {
return NextResponse.json(
{
success: false,
error: error?.message || 'Unknown error',
},
{ status: 500 },
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Api returns error.message 📘 Rule violation ⛨ Security

/api/songs/tosing/guest에서 Supabase 오류의 error.message를 그대로 응답으로 반환하고 있습니다.
• DB/내부 구현 관련 오류 메시지가 사용자에게 노출될 수 있어, 공격자에게 시스템 정보를 제공할 위험이 있습니다.
• 사용자-facing 응답은 일반화하고, 상세 오류는 내부 로그로만 남겨야 합니다.
Agent Prompt
## Issue description
`/api/songs/tosing/guest`가 Supabase의 `error.message`를 그대로 사용자에게 반환하여 내부 정보가 노출될 수 있습니다.

## Issue Context
컴플라이언스(secure error handling)는 사용자-facing 오류 응답에 내부 구현/DB 상세를 포함하지 말 것을 요구합니다.

## Fix Focus Areas
- apps/web/src/app/api/songs/tosing/guest/route.ts[23-30]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +9 to +21
const searchParams = request.nextUrl.searchParams;
const ids = searchParams.getAll('songIds[]');

if (!ids || ids.length === 0) {
return NextResponse.json({ success: true, data: [] });
}

const supabase = await createClient();

const { data, error } = await supabase
.from('songs')
.select('*', { count: 'exact' })
.in('id', ids);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. songids[] not validated 📘 Rule violation ⛨ Security

• 외부 입력인 쿼리 파라미터 songIds[]를 형식/길이/개수 제한 없이 그대로 DB 조회에 사용하고 있습니다.
• 비정상적으로 많은 ID 요청(DoS성)이나 잘못된 형식 입력으로 인한 예외/성능 저하를 유발할 수 있습니다.
• ID 형식(예: UUID) 검증과 최대 개수 제한, 빈 값/중복 처리 등을 추가해야 합니다.
Agent Prompt
## Issue description
`songIds[]`가 검증 없이 DB 조회에 사용되어 악성/비정상 입력에 취약합니다.

## Issue Context
security-first input validation 요구사항에 따라 외부 입력은 검증/정제되어야 합니다.

## Fix Focus Areas
- apps/web/src/app/api/songs/tosing/guest/route.ts[9-21]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +60 to +62
queryClient.setQueryData(['toSingSong'], (old: ToSingSong[]) => {
old.filter(song => song.songs.id !== songId);
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

4. setquerydata returns undefined 📘 Rule violation ⛯ Reliability

useDeleteToSingSongMutation().onMutate에서 setQueryData 콜백이 old.filter(...) 결과를 return하지 않아
  캐시가 undefined로 설정될 수 있습니다.
• 이후 렌더/로직에서 배열을 기대하면 런타임 오류로 이어져, 실패 지점에 대한 방어가 부족합니다.
• 필터 결과를 반환하고, oldundefined/빈 배열인 케이스도 안전하게 처리해야 합니다.
Agent Prompt
## Issue description
`setQueryData` 콜백이 값을 반환하지 않아 캐시가 `undefined`가 될 수 있습니다.

## Issue Context
robust error handling 요구사항에 따라 예외/엣지 케이스(예: undefined 데이터)를 방어하고, 상태 업데이트는 항상 일관된 타입을 유지해야 합니다.

## Fix Focus Areas
- apps/web/src/queries/tosingSongQuery.ts[57-63]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

queryClient.invalidateQueries({ queryKey: ['recentSingLog'] });
queryClient.invalidateQueries({ queryKey: ['searchSong'] });
},
onError: error => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. alert(error.message) used 📘 Rule violation ⛨ Security

• 여러 React Query mutation 에러 처리에서 alert(error.message)로 내부 오류 메시지를 사용자에게 직접 노출하고 있습니다.
• 네트워크/서버/DB 관련 상세 메시지가 그대로 표시될 수 있어 보안상 위험하며, 사용자 경험도 저해됩니다.
• 사용자-facing 메시지는 일반화하고, 디버깅용 상세는 내부 로그로 분리해야 합니다.
Agent Prompt
## Issue description
mutation 실패 시 `alert(error.message)`로 내부 오류 상세가 사용자에게 노출됩니다.

## Issue Context
secure error handling 요구사항에 따라 사용자-facing 오류는 일반화하고, 상세는 내부 로그로만 남겨야 합니다.

## Fix Focus Areas
- apps/web/src/queries/tosingSongQuery.ts[44-47]
- apps/web/src/queries/songThumbQuery.ts[28-31]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

[FEAT] Footer 애니메이션 기능 [FEAT] 비회원 곡 추가 기능

1 participant