Repository navigation
Conversation
## 문제
월이 바뀔 때(예: 3월 → 4월) 이전 달 데이터가 월간/30일 통계에서
사라지는 버그입니다.
**원인**: 디스크 캐시에 1월, 2월만 있고 3월이 없는 상태에서
4월 1일에 앱을 실행하면, `has_historical = true` 조건으로 인해
3월 파일이 모두 스킵됩니다. 3월은 캐시에도 없고 파싱도 되지 않아
데이터가 사라집니다.
**근본 원인**: 3월은 "현재 달"로 사용되는 동안 디스크 캐시에 저장되지
않습니다. 4월이 되어 3월이 "과거 달"이 되었을 때 캐시에 없지만 스킵됩니다.
## 수정 내용
- `prev_month_str()` 헬퍼 함수 추가
- 최적화 조건 변경:
- 기존: `only_current = has_historical` (캐시가 존재하면 현재 달만 파싱)
- 수정: `only_current = has_historical && cache.contains_key(&prev_month)`
(이전 달이 캐시에 있을 때만 스킵)
- 전체 파싱 시 캐시에 없는 과거 달을 집계하여 디스크에 저장
(기존 캐시 데이터는 유지, 누락된 달만 추가)
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
shindonghwi
force-pushed
the
fix/march-data-missing-from-monthly-stats
branch
from
March 31, 2026 15:50
54f5079 to
071af18
Compare
soulduse
approved these changes
Mar 31, 2026
soulduse
left a comment
Owner
There was a problem hiding this comment.
정확한 버그 분석과 깔끔한 수정 감사합니다! 🙌
월 전환 시점에 이전 달 데이터가 디스크 캐시에도 없고 파싱에서도 스킵되는 문제를 정확히 짚어주셨네요. 특히 prev_month 체크로 보수적으로 전체 파싱을 수행하는 접근이 안전하고 좋습니다.
기존 save_historical_months() 메서드가 더 이상 호출되지 않아 dead code로 남는 부분은 제가 후속으로 정리하겠습니다.
혹시 직접 월 전환 시점에서 이 버그를 경험하시면서 발견하신 건가요? 실사용 중에 찾아주신 거라면 더 감사하네요!
Contributor
Author
|
네 월 전환 시점에 밤새 코딩중이였는데,, ㅎㅎ 계산 되던게 조금 이상해보여서 코드 찾아봤습니다~ |
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.
문제
월이 바뀔 때(예: 3월 → 4월) 이전 달 데이터가 월간 통계에서 사라지는 버그입니다.
원인 (
claude_code.rs의full_parse):current_month = "2026-04".only_current = has_historical조건이true가 되어 mtime이 4월 이전인 파일이 모두 스킵됩니다.수정 내용
prev_month_str()헬퍼 함수 추가.if !only_current블록으로 통합. 최초 콜드 스타트 케이스와 "캐시는 있지만 일부 달 누락" 케이스 모두 처리합니다. 캐시에 없는 과거 달은 집계 후 디스크에 저장되어 이후 재시작 시 빠르게 로드됩니다.재현 방법