Skip to content

[FIX] 오늘/집중 탭 변경 후 통계 캐시 갱신#266

Merged
jjangminii merged 1 commit into
developfrom
fix/web/265-today-statistics-cache
Jul 17, 2026
Merged

[FIX] 오늘/집중 탭 변경 후 통계 캐시 갱신#266
jjangminii merged 1 commit into
developfrom
fix/web/265-today-statistics-cache

Conversation

@yumin-kim2

Copy link
Copy Markdown
Contributor

ISSUE 🔗

close #265


What is this PR? 🔍

오늘 탭과 집중 탭에서 투두 상태 또는 타이머 상태가 변경된 뒤 통계 페이지의 캐시가 갱신되지 않던 문제를 수정했습니다.

  • 오늘 탭에서 투두 생성 성공 시 통계 query invalidate 추가
  • 오늘 탭에서 투두 완료 상태 변경 성공 시 통계 query invalidate 추가
  • 오늘 탭에서 실행 중인 타이머를 완료 처리한 뒤 통계 query invalidate 추가
  • 집중 탭에서 타이머 완료/종료 성공 시 통계 query invalidate 추가
  • 집중 탭에서 투두 완료 상태 변경 성공 시 통계 query invalidate 추가


To Reviewers

통계 값 자체는 프론트에서 계산하지 않고 서버 응답을 그대로 사용합니다.
이번 PR은 통계 계산 로직 변경이 아니라, 투두/타이머 변경 후 통계 관련 query가 stale 처리되도록 캐시 갱신 타이밍을 맞춘 작업입니다.


Screenshot 📷



Test Checklist ✔

  • 오늘 탭에서 투두 생성 후 통계 캐시가 갱신되는지 확인
  • 오늘 탭에서 완료 체크 변경 후 통계 캐시가 갱신되는지 확인
  • 집중 탭에서 완료 체크/타이머 완료·종료 후 통계 캐시가 갱신되는지 확인
  • pnpm lint:web
  • pnpm check-types:web

@yumin-kim2 yumin-kim2 linked an issue Jul 16, 2026 that may be closed by this pull request
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
timo Ready Ready Preview, Comment Jul 16, 2026 10:21am

Request Review

@github-actions
github-actions Bot requested review from ehye1 and kimminna July 16, 2026 10:21
@github-actions github-actions Bot added the ⏰ Timo-web Timo 웹 서비스 label Jul 16, 2026
@github-actions github-actions Bot added 🐛 Bug 기능이 정상적으로 작동하지 않는 문제 수정 ♣️ 유민 유민양 labels Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

투두 생성·완료와 포커스 타이머 변경 성공 흐름에서 통계 쿼리 캐시 무효화를 추가했습니다. 기존 오늘 화면, 타이머, 투두 관련 캐시 무효화와 오류 처리는 유지됩니다.

Changes

통계 캐시 갱신

Layer / File(s) Summary
투두·타이머 성공 흐름의 통계 무효화
apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_hooks/todo-modal/use-create-todo-submit.ts, apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_hooks/useTodayTodoList.ts, apps/timo-web/app/[locale]/(main)/focus/_hooks/use-focus-session.ts
투두 생성, 완료 상태 변경, 중지 후 완료, 타이머 완료 및 투두 상태 변경 성공 시 invalidateStatistics()를 호출합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • Team-Timo/Timo-client#263: 투두 생성·완료 후 통계 캐시가 갱신되지 않는 동일한 누락을 다룹니다.

Possibly related PRs

Suggested reviewers: kimminna

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 오늘 탭의 투두 생성·완료·타이머 완료 후 통계 invalidate가 추가되어 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 추가된 집중 탭 invalidation도 동일한 통계 캐시 정합성 범위 안이라 별도 이탈 변경으로 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed 제목이 오늘/집중 탭에서 통계 캐시를 갱신하도록 한 핵심 변경을 간결하게 잘 요약합니다.
Description check ✅ Passed 설명이 변경 범위와 목적(투두·타이머 후 통계 query invalidate)을 정확히 연결해 무난합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/web/265-today-statistics-cache

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yumin-kim2 yumin-kim2 changed the title [FIX]: 오늘/집중 탭 변경 후 통계 캐시 갱신 (#265) [FIX] 오늘/집중 탭 변경 후 통계 캐시 갱신 (#265) Jul 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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
`@apps/timo-web/app/`[locale]/(main)/(with-time-sidebar)/today/_hooks/useTodayTodoList.ts:
- Line 154: Update the stopTimer mutation’s onSuccess handler in
useTodayTodoList so it immediately calls invalidateStatistics() after the timer
stops successfully, while retaining the existing call in
changeTodoStatus.onSuccess to reflect later todo-status updates as well.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 82149243-7982-40f0-b77b-d14b9df240ed

📥 Commits

Reviewing files that changed from the base of the PR and between 6015b4c and bfb06eb.

📒 Files selected for processing (3)
  • apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_hooks/todo-modal/use-create-todo-submit.ts
  • apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_hooks/useTodayTodoList.ts
  • apps/timo-web/app/[locale]/(main)/focus/_hooks/use-focus-session.ts

invalidateTodayView();
invalidateTodoDetail(todoId, dateKey);
invalidateFocusTodo();
invalidateStatistics();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

타이머 중지 성공 직후에도 통계를 무효화해야 합니다.

현재 invalidateStatistics()changeTodoStatus.onSuccess 내부에만 있어, stopTimer는 성공했지만 후속 투두 완료 상태 변경이 실패하면 통계 캐시가 갱신되지 않습니다. stopTimer.onSuccess에서 즉시 한 번 호출하고, 투두 상태 변경 성공 후에도 현재 호출을 유지해 두 mutation의 성공 결과를 모두 반영하세요.

포커스 훅의 stopTimer 성공 처리처럼 타이머 mutation 성공 지점에 직접 배치하는 방식이 안전합니다. TanStack Query도 mutation 성공 시 관련 query를 invalidate하는 패턴을 안내합니다. (tanstack.com)

🤖 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
`@apps/timo-web/app/`[locale]/(main)/(with-time-sidebar)/today/_hooks/useTodayTodoList.ts
at line 154, Update the stopTimer mutation’s onSuccess handler in
useTodayTodoList so it immediately calls invalidateStatistics() after the timer
stops successfully, while retaining the existing call in
changeTodoStatus.onSuccess to reflect later todo-status updates as well.

@github-actions

Copy link
Copy Markdown

Timo Performance Report

Bundle Size — timo-web
라우트 크기 First Load JS
/[locale]/home 214.14 kB 🔴 420.04 kB
/[locale]/today 198.34 kB 🔴 404.23 kB
/[locale]/focus 161.99 kB 🔴 367.88 kB
/[locale]/settings 168.81 kB 🔴 374.70 kB
/[locale]/statistics 155.72 kB 🔴 361.61 kB
/[locale]/[...rest] 0 B 🟡 205.89 kB
/[locale]/login 213.80 kB 🔴 419.69 kB
/[locale]/oauth/calendar/callback 120.82 kB 🟡 326.71 kB
/[locale]/oauth/callback 120.49 kB 🟡 326.38 kB
/[locale]/onboarding 234.55 kB 🔴 440.45 kB
/[locale] 119.80 kB 🟡 325.69 kB
/[locale]/policy 125.93 kB 🟡 331.82 kB
/robots.txt/route 0 B 🟡 205.89 kB
/sitemap.xml/route 0 B 🟡 205.89 kB

공유 번들: 205.89 kB
🟢 < 200kB  |  🟡 < 350kB  |  🔴 ≥ 350kB (First Load JS · gzip)

Lighthouse — timo-web
URL Perf A11y LCP CLS TBT
/en/home 🔴 60 🟢 95 🔴 15.8s 🟢 0.000 🟡 559ms
/en/today 🔴 62 🟢 95 🔴 15.7s 🟢 0.000 🟡 487ms
/en/focus 🔴 62 🟢 95 🔴 15.2s 🟢 0.000 🟡 518ms
/en/statistics 🔴 60 🟢 95 🔴 15.3s 🟢 0.000 🟡 562ms

Perf ≥ 70 / A11y ≥ 85 목표
LCP 🟢 < 2.5s 🟡 < 4s 🔴 ≥ 4s  |  CLS 🟢 < 0.1 🟡 < 0.25 🔴 ≥ 0.25  |  TBT 🟢 < 200ms 🟡 < 600ms 🔴 ≥ 600ms

Image Optimization — timo-web
파일 크기 포맷 상태
favicon.png 27.84 kB PNG ⚠️ 🟢
images/google-calendar.png 36.20 kB PNG ⚠️ 🟢
images/google-logo.png 26.79 kB PNG ⚠️ 🟢
og.png 437.44 kB PNG ⚠️ 🟡

총 4개 · 528.28 kB  |  🟢 < 200KB  |  🟡 < 500KB  |  🔴 ≥ 500KB
⚠️ 4개 파일 WebP/AVIF 변환 권장

측정 커밋: 1806eaf

@jjangminii jjangminii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

체크아웃해서 확인했습니다~

@jjangminii
jjangminii merged commit 1a29371 into develop Jul 17, 2026
18 checks passed
@jjangminii jjangminii mentioned this pull request Jul 17, 2026
@kimminna kimminna changed the title [FIX] 오늘/집중 탭 변경 후 통계 캐시 갱신 (#265) [FIX] 오늘/집중 탭 변경 후 통계 캐시 갱신 Jul 17, 2026
@kimminna
kimminna deleted the fix/web/265-today-statistics-cache branch July 17, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⏰ Timo-web Timo 웹 서비스 ♣️ 유민 유민양 🐛 Bug 기능이 정상적으로 작동하지 않는 문제 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 투두 변경 후 통계 캐시가 갱신되지 않는 문제

2 participants