Skip to content

fix: 홈 화면의 시간 계산 오류 수정#291

Merged
clxxrlove merged 2 commits into
developfrom
fix/#290/TWI-83
May 13, 2026
Merged

fix: 홈 화면의 시간 계산 오류 수정#291
clxxrlove merged 2 commits into
developfrom
fix/#290/TWI-83

Conversation

@clxxrlove
Copy link
Copy Markdown
Member

🔗 관련 이슈

📙 작업 내역

  • HomeReducer에서 nowDate가 한 번만 평가되던 문제 수정
    • 사용 시점에서 평가하도록 수정, HomeReducer가 최초 생성된 이후 nowDate가 평가되어 고정되는 문제였음
  • CalenderNow의 타임존 고정 (사실 별 이슈는 아니지만)

@linear
Copy link
Copy Markdown

linear Bot commented May 12, 2026

TWI-83

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b6448307-be04-4429-9f5d-bb69be72eda2

📥 Commits

Reviewing files that changed from the base of the PR and between 3f76ddf and b5fcb60.

📒 Files selected for processing (2)
  • Projects/Feature/Home/Interface/Sources/Home/HomeReducer.swift
  • Projects/Shared/Util/Sources/CalendarNow.swift

📝 Walkthrough

시간 계산 오류 수정

문제

홈 화면의 Reducer 상태에서 현재 시간(nowDate)이 Reducer 초기화 시점에만 평가되어 고정되는 문제로 인해, 특정 시간(예: 오전 9시)에 인증이 불가능한 버그 발생.

아키텍처 변경

HomeReducer.State.nowDate - 상태 속성 재구성

  • let 저장 프로퍼티 → var 계산 프로퍼티로 변경
  • 매 접근 시마다 새로운 CalendarNow() 인스턴스 생성하도록 변경
  • 결과: 상태에 접근할 때마다 현재 시간이 동적으로 평가됨

CalendarNow - 타임존 처리 개선

  • calendar 파라미터 초기값을 클로저로 변경: 명시적으로 타임존을 .current로 고정
  • Gregorian 캘린더 생성 시 타임존 설정을 명확하게 정의하여 시간 계산 일관성 확보

동작 변화

  • 홈 화면에서 현재 시간 정보가 스테이트 접근마다 갱신되어 시간 기반 인증 로직의 정확성 향상
  • 타임존 관련 예측 불가능한 동작 제거로 특정 시점의 인증 실패 방지

관련 이슈

  • Closes #290 (TWI-83)

전체 변경사항

현재 시간 정보를 항상 최신으로 유지하기 위해 CalendarNow 유틸리티와 HomeReducer 상태를 수정했습니다.

변경사항

현재 날짜/시간 타임존 수정

레이어 / 파일 요약
CalendarNow 타임존 처리
Projects/Shared/Util/Sources/CalendarNow.swift
calendar 초기화 로직이 클로저로 변경되어 Gregorian calendar를 생성하고 현재 타임존을 명시적으로 설정합니다.
HomeReducer 계산 속성 nowDate
Projects/Feature/Home/Interface/Sources/Home/HomeReducer.swift
nowDate 속성이 저장 상수에서 계산 속성으로 변경되어 매 접근 시마다 새로운 CalendarNow() 인스턴스를 생성합니다.

추정 코드 리뷰 노력

🎯 1 (간단함) | ⏱️ ~8분

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#290/TWI-83

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

@clxxrlove
Copy link
Copy Markdown
Member Author

@coderabbitai summary

@clxxrlove clxxrlove added the fix label May 12, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

✅ Actions performed

Summary regeneration triggered.

@jihun32
Copy link
Copy Markdown
Contributor

jihun32 commented May 13, 2026

👍

@clxxrlove clxxrlove merged commit 372cc61 into develop May 13, 2026
6 checks passed
@clxxrlove clxxrlove deleted the fix/#290/TWI-83 branch May 13, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants