20260526 #83 today stats 누적 통계 필드 3개 클라이언트 연동#84
Hidden character warning
Conversation
|
Warning Review limit reached
More reviews will be available in 21 minutes and 47 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Walkthrough서버에서 추가한 누적 통계 필드 3개(lifetimeMinutes, lifetimeSessionCount, monthlyMinutes)를 Flutter 클라이언트의 DTO/엔티티에 추가하고, today_stats_provider의 게스트 모드 로직을 확장하여 로컬 세션에서 6필드를 모두 계산한 후, study_stats_provider의 파생 함수들을 단순화하는 통합 작업입니다. Changes누적 통계 필드 클라이언트 통합
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
test/features/timer/presentation/providers/today_stats_provider_test.dart (1)
41-44: ⚡ Quick win인증 모드 검증은 6필드 전체를 확인하는 편이 안전합니다.
현재는 일부 필드만 검증해서, 신규 누적 필드 중
lifetimeSessionCount/monthlyMinutes회귀를 놓칠 수 있습니다.제안 diff
expect(stats.totalMinutes, 180); + expect(stats.sessionCount, 3); expect(stats.streak, 7); expect(stats.lifetimeMinutes, 12450); + expect(stats.lifetimeSessionCount, 287); + expect(stats.monthlyMinutes, 1820);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/features/timer/presentation/providers/today_stats_provider_test.dart` around lines 41 - 44, The test currently only asserts stats.totalMinutes, stats.streak, and stats.lifetimeMinutes; add assertions for the remaining fields to fully validate the "today stats" shape and catch regressions (specifically add expectations for stats.lifetimeSessionCount and stats.monthlyMinutes and any other missing fields returned by TodayStats, e.g., stats.monthlySessionCount) so the test covers all six fields produced by the provider.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/api-docs.json`:
- Around line 1466-1482: The 401 and 500 response entries for GET
/api/fuel/transactions incorrectly reference FuelTransactionListResponse; update
those response objects to reference the ErrorResponse schema instead. Locate the
response objects that use "$ref":
"`#/components/schemas/FuelTransactionListResponse`" under the 401 and 500 keys
and replace them with "$ref": "`#/components/schemas/ErrorResponse`" so the error
contract is documented correctly.
- Around line 384-390: The 401 response for GET /api/timer-sessions currently
references the success DTO TimerSessionListResponse; update that schema
reference to ErrorResponse so authentication failures use the correct error
contract (replace "$ref": "`#/components/schemas/TimerSessionListResponse`" with
"$ref": "`#/components/schemas/ErrorResponse`" in the 401 response block for GET
/api/timer-sessions).
In `@lib/features/timer/presentation/providers/today_stats_provider.dart`:
- Around line 47-53: TodayStats.streak is being set to a binary value using
todaySessions.isEmpty ? 0 : 1 which loses the actual consecutive-day count
(breaking guest streaks); replace that ternary with the real streak value
produced by currentStreakProvider (or the existing computed streak variable) so
TodayStats receives the full integer streak instead of 0/1—i.e., locate the
TodayStats constructor call and change streak: todaySessions.isEmpty ? 0 : 1 to
streak: <use the currentStreakProvider result or the computed streak variable>.
In
`@test/features/timer/data/datasources/timer_session_remote_datasource_test.dart`:
- Around line 91-95: The test for api.getTodayStats() is missing assertions for
the newly added response fields lifetimeSessionCount and monthlyMinutes; update
the assertion block in timer_session_remote_datasource_test.dart (the test that
calls api.getTodayStats() and assigns to res) to include
expect(res.lifetimeSessionCount, <expectedValue>) and expect(res.monthlyMinutes,
<expectedValue>) using the correct expected numbers from the JSON test fixture
used by the test, so the expanded schema is fully validated alongside
totalMinutes, streak and lifetimeMinutes.
In
`@test/features/timer/data/repositories/timer_session_repository_impl_test.dart`:
- Around line 183-186: The test currently asserts stats.totalMinutes,
stats.streak and stats.lifetimeMinutes but misses verifying the two new
cumulative fields, causing mapping errors to go unnoticed; update the same test
(the block where the local variable stats is asserted) to also assert
stats.lifetimeSessionCount and stats.monthlyMinutes with their expected values
so the new fields are validated alongside lifetimeMinutes.
---
Nitpick comments:
In `@test/features/timer/presentation/providers/today_stats_provider_test.dart`:
- Around line 41-44: The test currently only asserts stats.totalMinutes,
stats.streak, and stats.lifetimeMinutes; add assertions for the remaining fields
to fully validate the "today stats" shape and catch regressions (specifically
add expectations for stats.lifetimeSessionCount and stats.monthlyMinutes and any
other missing fields returned by TodayStats, e.g., stats.monthlySessionCount) so
the test covers all six fields produced by the provider.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 98274398-4c4c-4002-af0d-d0a5cbd9ed6a
📒 Files selected for processing (19)
docs/api-docs.jsondocs/superpowers/plans/2026-05-27-today-stats-cumulative-fields-frontend.mddocs/superpowers/specs/2026-05-27-today-stats-cumulative-fields-frontend-design.mdlib/features/timer/data/models/today_stats_response_model.dartlib/features/timer/data/models/today_stats_response_model.freezed.dartlib/features/timer/data/models/today_stats_response_model.g.dartlib/features/timer/domain/entities/today_stats.dartlib/features/timer/domain/entities/today_stats.freezed.dartlib/features/timer/presentation/providers/study_stats_provider.dartlib/features/timer/presentation/providers/study_stats_provider.g.dartlib/features/timer/presentation/providers/today_stats_provider.dartlib/features/timer/presentation/providers/today_stats_provider.g.dartlib/features/timer/presentation/screens/timer_screen.darttest/features/timer/data/datasources/timer_session_remote_datasource_test.darttest/features/timer/data/models/today_stats_response_model_test.darttest/features/timer/data/repositories/timer_session_repository_impl_test.darttest/features/timer/domain/entities/today_stats_test.darttest/features/timer/presentation/providers/study_stats_provider_test.darttest/features/timer/presentation/providers/today_stats_provider_test.dart
…tion 보강 #83 - today_stats_provider 게스트 분기 streak 0/1 고정 회귀 → 로컬 세션 날짜 fold 로 다일 연속 계산 복원 - docs/api-docs.json 의 에러 상태(401/500) 응답 스키마가 성공 DTO 를 참조하던 4곳을 ErrorResponse 로 교정: * GET /api/timer-sessions 401 (TimerSessionListResponse -> ErrorResponse) * POST /api/timer-sessions 500 (TimerSessionCreateResponse -> ErrorResponse) * GET /api/timer-sessions/today-stats 401 (TodayStatsResponse -> ErrorResponse) * GET /api/fuel/transactions 401/500 (FuelTransactionListResponse -> ErrorResponse) - timer_session_remote_datasource_test / repository_impl_test: lifetimeSessionCount, monthlyMinutes assertion 보강 - 게스트 다일 streak 회귀 가드 테스트 추가 (3일 연속 -> streak=3)
✨ 변경 사항
✅ 테스트
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests