Skip to content

fix: FCM 토큰 조회 실패 시 예외 처리 - #991

Open
devfeijoa wants to merge 1 commit into
developfrom
fix/990
Open

devfeijoa wants to merge 1 commit into
developfrom
fix/990

Conversation

@devfeijoa

@devfeijoa devfeijoa commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • HomeFragment.updateFCMToken()이 task.isSuccessful을 확인하기 전에 task.result를 먼저 읽고 있었습니다. FCM 토큰 조회가 실패하면 여기서 예외가 발생해 앱이 종료될 수 있습니다.
  • 조회 성공을 확인한 뒤에 task.result를 읽도록 순서를 바꿨습니다. MainActivity.updateFcmToken()과 같은 순서입니다.

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

없음 (동작 순서만 바뀌고 화면 변경은 없습니다)

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

  • 작성 환경에서 Gradle을 실행할 수 없어 빌드·ktlint는 아직 확인하지 않았습니다. 로컬에서 ./gradlew :app:assembleDebug, ./gradlew ktlintCheck 확인이 필요합니다.

Generated by Claude Code

Summary by CodeRabbit

  • 버그 수정
    • FCM 토큰 조회가 성공한 경우에만 토큰을 처리하도록 개선했습니다.

조회에 실패한 Task에서 result를 먼저 읽어 예외가 발생할 수 있던 순서를 바로잡는다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LadGaN6dV9EWkt5FMCWD6C
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

HomeFragment.updateFCMToken()은 조회 성공 여부를 확인한 뒤 FCM 토큰 결과를 읽습니다. 최초 실행 시 토큰을 저장하고, 그 외에는 갱신하는 동작을 유지합니다.

Changes

FCM 토큰 조회

Layer / File(s) Summary
조회 성공 확인 후 토큰 읽기
app/src/main/java/com/into/websoso/ui/main/home/HomeFragment.kt
task.isSuccessful이 참일 때만 task.result를 읽습니다. 최초 실행 시 저장하고 그 외에는 갱신합니다.

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: sadturtleman

Merge Risk: Minimal · up to 82620

The FCM token failure handling is corrected; the change is mergeable pending normal local build checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed PR 제목 "fix: FCM 토큰 조회 실패 시 예외 처리"은 변경 내용의 핵심을 설명합니다. HomeFragment.updateFCMToken()에서 task.isSuccessful을 확인한 뒤에 task.result를 읽도록 순서를 바꾼 변경과 일치합니다. 제목은 짧고 구체적이며, 수정 유형(fix)과 대상 동작이 드러납니다.
Description check Passed PR 설명은 템플릿의 주요 섹션(이슈, 작업 설명, 스크린샷, 리뷰어에게 전달할 내용)을 모두 포함합니다. 이슈 #990을 연결했고, 변경 이유(조회 실패 시 예외 가능성)와 변경 내용(task.isSuccessful 확인 후 task.result 읽기)을 설명했습니다. 스크린샷 섹션은 화면 변경이 없다는 근거와 함께 '없음'으로 채워졌습니다. 빌드와 kt…
Linked Issues check Passed [#990] 요구 사항은 HomeFragment.updateFCMToken()에서 task.isSuccessful을 확인한 뒤에 task.result를 읽도록 하는 것입니다. 전체 PR diff(merge base 2f03a72 대비 head 8262019)에서 HomeFragment.kt의 val token = task.result 줄이 if (tas…
Out of Scope Changes check Passed 전체 PR diff는 app/src/main/java/com/into/websoso/ui/main/home/HomeFragment.kt 한 파일만 변경합니다(+2/-2). 변경은 updateFCMToken()의 읽기 순서 수정과 그 이유를 설명하는 한 줄 주석입니다. 이는 #990 요구 사항과 직접 관련됩니다. 화면, 다른 파일, 공개 선언에 대한 변경은 …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Description check

Explanation

PR 설명은 템플릿의 주요 섹션(이슈, 작업 설명, 스크린샷, 리뷰어에게 전달할 내용)을 모두 포함합니다. 이슈 #990을 연결했고, 변경 이유(조회 실패 시 예외 가능성)와 변경 내용(task.isSuccessful 확인 후 task.result 읽기)을 설명했습니다. 스크린샷 섹션은 화면 변경이 없다는 근거와 함께 '없음'으로 채워졌습니다. 빌드와 ktlint 검증은 아직 수행하지 않았다고 명시되어 있습니다.

Full details: Linked Issues check

Explanation

[#990] 요구 사항은 HomeFragment.updateFCMToken()에서 task.isSuccessful을 확인한 뒤에 task.result를 읽도록 하는 것입니다. 전체 PR diff(merge base 2f03a72 대비 head 8262019)에서 HomeFragment.kt의 val token = task.result 줄이 if (task.isSuccessful) 블록 안으로 이동했습니다. 실패한 Task에서 result를 읽으면 예외가 발생하므로, 이 변경으로 해당 요구 사항이 충족됩니다. 토큰 변수는 성공 블록 안에서만 사용되며, 최초 실행 시 saveFCMToken, 그 외에는 updateFCMToken 호출 동작이 유지됩니다. issue 메타데이터는 State: open이지만 PR 설명은 closed로 표시합니다. 상태와 무관하게 요구 사항이 충족되므로 결론은 같습니다. 빌드와 ktlint는 실행하지 않았습니다. 다만 diff에서 token 참조 범위가 성공 블록으로 제한됨을 확인했습니다.

Full details: Out of Scope Changes check

Explanation

전체 PR diff는 app/src/main/java/com/into/websoso/ui/main/home/HomeFragment.kt 한 파일만 변경합니다(+2/-2). 변경은 updateFCMToken()의 읽기 순서 수정과 그 이유를 설명하는 한 줄 주석입니다. 이는 #990 요구 사항과 직접 관련됩니다. 화면, 다른 파일, 공개 선언에 대한 변경은 확인되지 않았습니다.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

토끼가 토큰 순서를 살펴봐요
성공한 뒤에 결과를 읽어요
실패한 길은 조용히 지나고
저장과 갱신은 그대로 이어져요
달빛 아래 귀를 쫑긋 세워요

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f3802fa-45ea-47bc-90ee-0e6c4dadc584
Commits

Reviewing files that changed from the base of the PR and between 2f03a72 and 8262019.

Files selected for processing: 1

  • app/src/main/java/com/into/websoso/ui/main/home/HomeFragment.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: FCM 토큰 조회 실패 시 예외 처리

2 participants