Skip to content

fix/#107: SplashViewModel 업데이트 판별 로직 엣지 케이스 수정#108

Merged
DongChyeon merged 3 commits into
developfrom
feature/#107-fix-splash-update-logic
May 9, 2026
Merged

fix/#107: SplashViewModel 업데이트 판별 로직 엣지 케이스 수정#108
DongChyeon merged 3 commits into
developfrom
feature/#107-fix-splash-update-logic

Conversation

@DongChyeon
Copy link
Copy Markdown
Member

@DongChyeon DongChyeon commented May 9, 2026

🛠 Related issue

closed #107

어떤 변경사항이 있었나요?

  • 🐞 BugFix Something isn't working
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (Junit, etc.)

✅ CheckPoint

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 컨벤션에 맞게 작성했습니다. (필수)
  • merge할 브랜치의 위치를 확인해 주세요(main❌/develop⭕) (필수)
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다. (필수)
  • BugFix의 경우, 버그의 원인을 파악하였습니다. (선택)

✏️ Work Description

SplashViewModel.determineDialogType에서 발견된 3가지 엣지 케이스 수정

  • [Fix 1] FORCE 전략 + 버전 조건 추가

    • 기존: updateStrategy == FORCE이면 현재 버전과 무관하게 항상 강제 업데이트 팝업 표시
    • 수정: currentVersion < latestVersion일 때만 FORCE 팝업 표시 (이미 최신 버전이면 스킵)
  • [Fix 2] 디바이스 시계 역행 시 소프트 업데이트 영구 미표시 버그 수정

    • 기존: currentTime - lastShown < 0이면 24시간 조건 불만족 → 소프트 업데이트 영원히 미표시
    • 수정: lastShown > now이면 effectiveLastShown = 0으로 처리하여 즉시 표시
  • [Fix 3] dismissSoftUpdate DataStore 저장 실패 시 무음 처리 개선

    • 기존: 저장 실패 예외를 조용히 삼킴
    • 수정: Log.e로 에러 기록 + CancellationException 명시적 재전파
  • [Refactor] 순수 결정 로직 추출

    • resolveUpdateDialogType internal 함수로 분리 (Android 의존성 없음)
    • ViewModel은 DataStore에서 읽은 값을 파라미터로 전달하여 위임
  • [Test] 업데이트 판별 로직 유닛 테스트 12개 추가

    • SplashUpdateLogicTest — 모든 전략/버전 조합 및 시계 역행, 최초 설치 케이스 커버

😅 Uncompleted Tasks

  • N/A

📢 To Reviewers

  • resolveUpdateDialogTypeinternal인 이유: Kotlin top-level private은 파일-private이라 동일 모듈의 다른 파일(테스트)에서 접근 불가. internal이 테스트 접근을 위한 최소 공개 범위입니다.
  • Fix 1의 동작 변경: FORCE 전략이라도 currentVersion >= latestVersion이면 팝업을 표시하지 않습니다. 서버에서 이미 최신 버전인 유저에게 FORCE를 보내는 경우는 잘못된 서버 설정으로 간주하여 클라이언트에서 방어합니다.

Summary by CodeRabbit

릴리스 노트

  • 버그 수정

    • 앱 업데이트 대화상자의 버전 비교 로직이 개선되었습니다.
    • 소프트 업데이트 표시 시간 처리가 더욱 안정적으로 작동합니다.
  • 테스트

    • 앱 업데이트 대화상자 동작 검증을 위한 포괄적인 테스트 스위트가 추가되었습니다.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: ff153847-8f0d-4e80-a6a8-609211278667

📥 Commits

Reviewing files that changed from the base of the PR and between 324fbe8 and e5b1f1f.

📒 Files selected for processing (4)
  • .editorconfig
  • feature/auth/build.gradle.kts
  • feature/auth/src/main/java/com/sseotdabwa/buyornot/feature/auth/ui/SplashViewModel.kt
  • feature/auth/src/test/java/com/sseotdabwa/buyornot/feature/auth/ui/SplashUpdateLogicTest.kt

개요

SplashViewModel의 앱 업데이트 다이얼로그 판별 로직을 재사용 가능한 resolveUpdateDialogType 함수로 추출하고, FORCE 전략의 버전 조건과 SOFT 전략의 시계 역행 처리를 개선하며, 13개 테스트 케이스로 전체 엣지 케이스를 검증합니다.

변경 사항

SplashViewModel 업데이트 로직 리팩토링 및 검증

Layer / File(s) 요약
업데이트 판별 로직 구현
feature/auth/src/main/java/com/sseotdabwa/buyornot/feature/auth/ui/SplashViewModel.kt
새로운 internal resolveUpdateDialogType(...) 함수로 업데이트 다이얼로그 결정 로직을 중앙화합니다. FORCE 전략은 currentVersion < latestVersion 조건을 추가하고, SOFT 전략은 lastSoftUpdateShownTime > now일 때 시계 역행으로 감지하여 0L로 리셋합니다. SOFT_UPDATE_INTERVAL_MILLIS, TAGprivate에서 internal로 변경되고, determineDialogTyperesolveUpdateDialogType을 호출하도록 리팩토링됩니다.
테스트 인프라
feature/auth/build.gradle.kts, .editorconfig
JUnit, Kotlin test, kotlinx-coroutines-test 의존성을 추가하고 [*Test.kt] 파일의 ktlint_standard_function-naming 규칙을 비활성화하여 한글 테스트 함수명을 허용합니다.
업데이트 로직 검증 테스트
feature/auth/src/test/java/com/sseotdabwa/buyornot/feature/auth/ui/SplashUpdateLogicTest.kt
13개 테스트 케이스로 null 입력, 최소 버전 미달, 각 UpdateStrategy별 버전 비교, 시간 경과 확인, 시계 역행 감지, 초기 설치 시나리오를 검증합니다.

🎯 2 (Simple) | ⏱️ ~12 분

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning PR의 변경 사항이 #107 이슈의 주요 요구사항을 상당 부분 충족하나, 일부 High/Medium 우선순위 항목이 누락되었습니다. #107의 '버전 비교를 Long 타입으로 전환해 오버플로우 방지'(Medium), 'Force 업데이트 dismiss 경로 확인 및 무한 대기 제거'(High)는 구현되지 않았으므로, 이 항목들을 추가로 구현하거나 이슈 체크리스트를 업데이트하기 바랍니다.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 '#107: SplashViewModel 업데이트 판별 로직 엣지 케이스 수정'으로, 변경의 핵심인 SplashViewModel의 엣지 케이스 수정을 명확하게 요약하고 있습니다.
Out of Scope Changes check ✅ Passed PR의 모든 변경 사항이 #107 이슈의 목표와 관련이 있으며, 범위를 벗어난 변경은 관찰되지 않습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feature/#107-fix-splash-update-logic

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@DongChyeon DongChyeon self-assigned this May 9, 2026
@DongChyeon DongChyeon requested a review from Imagine-Choi May 9, 2026 08:22
@DongChyeon DongChyeon added ✨ FEAT 기능 개발 (애매하면 기능 개발로 두도록 하자) 💪 동현동현동현 labels May 9, 2026
@DongChyeon DongChyeon merged commit 6e921ca into develop May 9, 2026
2 checks passed
@DongChyeon DongChyeon deleted the feature/#107-fix-splash-update-logic branch May 9, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ FEAT 기능 개발 (애매하면 기능 개발로 두도록 하자) 💪 동현동현동현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Feature - SplashViewModel 업데이트 판별 로직 엣지 케이스 수정

1 participant