[FIX] 홈 통계 카드 포커스 재조회 제거#77
Merged
Merged
Conversation
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.
Closes #76
개요
PR #69의
1981967커밋에서 홈 화면 통계 카드가 최신 데이터를 반영하도록useEffect기반 최초 조회 로직을useFocusEffect기반 포커스 재조회 로직으로 변경했습니다.하지만 홈 탭 재진입, 검사 결과 저장 후 홈 복귀, 탭 이동 등으로 홈 화면에 다시 포커스될 때마다
fetchVerdictStatistics가 호출될 수 있습니다.홈 통계 데이터는 약 50분 주기로 갱신되어도 충분하므로, 포커스마다 통계 API를 재호출하는 방식은 백엔드 서버에 불필요한 요청 부하를 줄 수 있다고 판단했습니다.
따라서 이번 작업에서는
1981967커밋의 포커스 재조회 변경 사항을 되돌리고, 기존처럼 홈 화면 최초 mount 시점에만 통계 데이터를 조회하도록 복구했습니다.주요 구현 내용
useFocusEffect제거useEffect기반 최초 mount 시점 통계 조회 방식으로 복구useFocusEffectimport 제거AbortController기반 요청 정리 흐름 유지파일별 역할
app/(tabs)/(home)/index.tsx: 홈 통계 카드 API 조회 시점을 포커스 재조회에서 최초 mount 조회 방식으로 복구해결한 이슈 목록
1981967커밋 변경 범위 확인useFocusEffect기반 통계 재조회 로직 제거useEffect기반 최초 mount 조회 방식 복구fetchVerdictStatistics가 반복 호출되지 않도록 수정체크 사항
git diff --check origin/dev...HEAD통과참고사항
1981967-fix: 홈 통계 카드 포커스 재조회 처리1fdbb9f-fix: 홈 통계 카드 포커스 재조회 제거node_modules가 없어npm run lint,npx tsc --noEmit은 실행하지 못했습니다.Screenshots or Video