Skip to content

RunActivity 타이머 크래시 수정 및 서버 URL prod 고정#375

Merged
unam98 merged 2 commits intodevelopfrom
feature/fix-run-timer-broadcast
Apr 3, 2026
Merged

RunActivity 타이머 크래시 수정 및 서버 URL prod 고정#375
unam98 merged 2 commits intodevelopfrom
feature/fix-run-timer-broadcast

Conversation

@unam98
Copy link
Copy Markdown
Collaborator

@unam98 unam98 commented Apr 3, 2026

작업 배경

  • Android 14+에서 RunActivity 진입 시 registerReceiverRECEIVER_EXPORTED/NOT_EXPORTED 플래그 누락으로 SecurityException 크래시 발생
  • 디버그 빌드에서 dev/node 서버(미운영)를 바라보는 문제로 API 요청 타임아웃

변경 사항

구분 파일 내용
수정 RunActivity.kt registerReceiverRECEIVER_NOT_EXPORTED 플래그 추가
수정 TimerService.kt sendBroadcastsetPackage(packageName) 추가하여 앱 내부 전달 보장
수정 ApplicationClass.kt getBaseUrl() 분기 주석 처리, prod URL 고정 반환

영향 범위

  • RunActivity: Android 14+ 크래시 해소 + 타이머 UI 정상 수신
  • 전체 API: 디버그 빌드에서도 prod 서버 사용으로 통일
  • 기존 서버 분기 로직은 주석 처리되어 추후 복원 가능

Test Plan

  • 디버그 빌드 성공 확인
  • RunActivity 진입 → 타이머 정상 표시 확인
  • 디버그 빌드에서 로그인 → API 통신 정상 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed API endpoint configuration to consistently use production URLs
    • Improved broadcast receiver registration for enhanced security and stability

unam98 added 2 commits April 3, 2026 15:01
- RunActivity: registerReceiver에 RECEIVER_NOT_EXPORTED 플래그 추가 (Android 14+ 필수)
- TimerService: sendBroadcast에 setPackage(packageName) 추가하여 앱 내부 전달 보장
- dev/node 서버 미운영 상태로 디버그 모드에서도 prod URL 사용
- 기존 분기 로직은 주석 처리하여 추후 복원 가능
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

The pull request consolidates API URL handling by removing dynamic base URL switching logic and hardcoding the production URL, while adding explicit broadcast receiver export flags and package targeting to restrict broadcast delivery scope to the app's own package.

Changes

Cohort / File(s) Summary
API Configuration
app/src/main/java/com/runnect/runnect/application/ApplicationClass.kt
Removed conditional base URL selection logic based on BuildConfig.DEBUG, app context initialization, and ApiMode.getCurrentApiMode(). Function now always returns BuildConfig.RUNNECT_PROD_URL.
Broadcast Receiver Security
app/src/main/java/com/runnect/runnect/presentation/run/RunActivity.kt, app/src/main/java/com/runnect/runnect/presentation/run/TimerService.kt
Added RECEIVER_NOT_EXPORTED flag to receiver registration in RunActivity.onStart() and added intent.setPackage(packageName) before broadcasting in TimerService to restrict broadcast delivery to the app package.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 No more branching paths to roam,
One prod URL becomes our home,
Receivers locked within the fold,
Broadcasts safe and tightly controlled! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: fixing the RunActivity timer crash and fixing the server URL to production.

✏️ 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/fix-run-timer-broadcast

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/java/com/runnect/runnect/application/ApplicationClass.kt (1)

42-58: Consider commenting out initApiMode() for consistency.

The getBaseUrl() change is correct for the current situation. However, initApiMode() (lines 29-32) is still being called in onCreate() despite having no effect now that getBaseUrl() ignores ApiMode. This creates orphaned code that may confuse future maintainers.

For consistency with the TODO restoration intent, consider commenting out the initApiMode() call as well:

♻️ Suggested cleanup
         KakaoSdk.init(this, getString(R.string.kakao_native_app_key))
-        initApiMode()
+        // TODO: dev/node 서버 복구 시 복원
+        // initApiMode()
         initAnalytics()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/runnect/runnect/application/ApplicationClass.kt` around
lines 42 - 58, The initApiMode() call in onCreate() should be removed or
commented out to avoid orphaned initialization since getBaseUrl() now always
returns BuildConfig.RUNNECT_PROD_URL; locate the onCreate() method in
ApplicationClass and comment out or delete the invocation of initApiMode()
(referencing the initApiMode() function and getBaseUrl() method) so the code and
the TODO/intent are consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/src/main/java/com/runnect/runnect/application/ApplicationClass.kt`:
- Around line 42-58: The initApiMode() call in onCreate() should be removed or
commented out to avoid orphaned initialization since getBaseUrl() now always
returns BuildConfig.RUNNECT_PROD_URL; locate the onCreate() method in
ApplicationClass and comment out or delete the invocation of initApiMode()
(referencing the initApiMode() function and getBaseUrl() method) so the code and
the TODO/intent are consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9c41a57-b644-44bc-a5d7-b4bb6c82b51c

📥 Commits

Reviewing files that changed from the base of the PR and between 9c62c23 and 3000d6b.

📒 Files selected for processing (3)
  • app/src/main/java/com/runnect/runnect/application/ApplicationClass.kt
  • app/src/main/java/com/runnect/runnect/presentation/run/RunActivity.kt
  • app/src/main/java/com/runnect/runnect/presentation/run/TimerService.kt

@unam98 unam98 self-assigned this Apr 3, 2026
@unam98 unam98 merged commit 8e57cf8 into develop Apr 3, 2026
2 checks passed
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.

1 participant