fix(feed): 댓글·콕찌르기 직후 프로필 이미지가 기본 이미지로 남는 문제 수정#165
Merged
Conversation
리액션은 성공 후 fetchDetail()로 서버 데이터를 재조회해 낙관적으로 넣은 기본 아바타를 실제 프로필 이미지로 교체하지만, 댓글과 콕찌르기는 그 재조회 호출이 없어 기본 아바타가 그대로 남아있었다. fetchComments를 useEffect 내부에서 재사용 가능한 함수로 추출하고, 댓글 전송/콕찌르기 성공 후에도 각각 재조회하도록 맞췄다. 콕찌르기 병합 로직도 낙관적 'me' 항목을 무조건 보존하던 것을 서버 데이터로 완전히 교체하도록 변경. Constraint: fetchDetail과 fetchComments는 서로 다른 엔드포인트를 호출함 Rejected: fetchDetail 안에서 댓글까지 함께 처리 | 댓글 데이터는 해당 응답에 없어 억지로 합치면 API 구조와 안 맞음 Confidence: high Scope-risk: narrow Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
변경 요약
논리적 설명
handleReact는 리액션 등록 성공 후fetchDetail()을 호출해 서버 데이터로 리스트를 재조회하지만, 댓글 전송(handleSendComment)과 콕 찌르기 핸들러는 그에 대응하는 재조회 호출이 없어 낙관적으로 넣은 기본 아바타(AVATAR_SOURCE)가 그대로 남아있었음fetchComments)이useEffect내부에 갇혀 있어 다른 곳에서 재호출이 불가능했던 것을useCallback으로 추출해 재사용 가능하게 변경fetchComments(), 콕 찌르기 성공 후fetchDetail()을 각각 호출하도록 추가fetchDetail내 콕 찌르기 병합 로직이 낙관적으로 추가한me항목을 서버 데이터로 교체하지 않고 무조건 보존하던 것을, 서버 데이터로 완전히 교체하도록 변경체크리스트
.env*) 키 추가/변경pnpm-lock.yaml등) 변경🤖 Generated with Claude Code