-
Notifications
You must be signed in to change notification settings - Fork 0
[PC-1624] 사용자에게 백그라운드 작업은 실패 시 기록만 하도록 수정 #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughError handling refactored across multiple components by introducing a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/domain/src/main/java/com/puzzle/domain/model/error/ErrorHelper.kt (1)
21-23: Consider adding documentation to clarify usage.The
recordErrorfunction implementation is correct—it logs errors without emitting user-facing events. However, adding KDoc would help developers understand when to userecordErrorvssendError.📝 Suggested documentation
+ /** + * Records an error for logging/monitoring purposes without notifying the user. + * Use this for background operations or non-critical failures where user notification is unnecessary. + * For user-facing errors, use [sendError] instead. + */ suspend fun recordError(error: Throwable) { errorRepository.logError(error) }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
app/src/main/java/com/puzzle/piece/notification/NotificationService.ktcore/data/src/main/java/com/puzzle/data/repository/NotificationRepositoryImpl.ktcore/domain/src/main/java/com/puzzle/domain/model/error/ErrorHelper.ktfeature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingViewModel.ktpresentation/src/main/java/com/puzzle/presentation/MainViewModel.kt
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-10T10:27:20.895Z
Learnt from: comst19
Repo: Piece-Puzzly/Piece-Android PR: 203
File: feature/setting/src/main/java/com/puzzle/setting/graph/main/SettingScreen.kt:242-246
Timestamp: 2026-01-10T10:27:20.895Z
Learning: In the Piece-Android project's SettingScreen.kt and AccessRightsPage.kt: The notification toggle represents the actual notification receivable state (combining system permission and app setting), and when system permission becomes granted, the app automatically enables push notifications through onPushNotificationCheckedChange() callback - this is intentional behavior per the app's notification policy.
Applied to files:
core/data/src/main/java/com/puzzle/data/repository/NotificationRepositoryImpl.ktapp/src/main/java/com/puzzle/piece/notification/NotificationService.kt
🧬 Code graph analysis (1)
presentation/src/main/java/com/puzzle/presentation/MainViewModel.kt (1)
core/common/src/main/java/com/puzzle/common/ResultUtil.kt (1)
suspendRunCatching(5-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (4)
app/src/main/java/com/puzzle/piece/notification/NotificationService.kt (1)
41-51: LGTM! Appropriate use ofrecordErrorfor background token updates.Using
recordErrorinstead ofsendErroris correct here. FCM token refresh is an automatic background operation, and failures should be logged for monitoring without disrupting the user experience.feature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingViewModel.kt (1)
100-109: LGTM! Role-based guard correctly prevents unnecessary operations.The early return guard ensures
fetchPuzzleCountonly executes forUserRole.USER, which aligns with the PR objective. This prevents unnecessary API calls for users in PENDING, BANNED, or NONE states who don't need puzzle count information.presentation/src/main/java/com/puzzle/presentation/MainViewModel.kt (1)
120-136: LGTM! Appropriate error handling for background data loading.The three background loading operations (
loadTerms,loadValuePicks,loadValueTalks) now correctly userecordErrorto silently log failures without showing user-facing errors. This is appropriate because:
- These are non-critical background data prefetches performed on app startup
- Failures don't prevent the app from functioning
- Errors are still logged for monitoring purposes
The selective use of
recordErrorvssendErrorthroughout the file is correct—critical operations like version checks (line 117) and session validation (line 152) still usesendErrorto alert users when necessary.core/data/src/main/java/com/puzzle/data/repository/NotificationRepositoryImpl.kt (1)
15-21: LGTM! Defensive token validation prevents unnecessary API calls.The change from direct access to
firstOrNull()with a null/blank check is a good defensive improvement. It prevents:
- Potential exceptions if the token flow is empty
- Unnecessary API calls when no valid access token is available
This aligns well with the overall PR theme of more robust error handling.
kkh725
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
백그라운드 작업의 범위가 어디까지인지 고민 해 볼 필요가 있는것 같아요.
고생하셨습니다~
1. ⭐️ 변경된 내용
2. 🖼️ 스크린샷(선택)
3. 💡 알게된 부분
4. 📌 이 부분은 꼭 봐주세요!
Summary by CodeRabbit
Bug Fixes
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.