[Feature] 로그아웃 및 세션 만료 GlobalNavEvent 적용#87
Conversation
- SessionEventBus: 앱 전역 세션 상태 전파를 위한 이벤트 버스 인터페이스 및 구현체 추가 - TokenRefresher: 토큰 갱신 실패(400, 401) 시 세션 만료 이벤트 발행 로직 추가 - MainActivity: 세션 만료 이벤트 구독 및 로그인 화면 이동, 스낵바 알림 표시 처리 - DataModule: SessionEventBus 의존성 바인딩 설정 추가
- onNavigateToLogin 콜백을 onGlobalNavEvent(GlobalNavEvent.Logout) 호출로 변경 - MyPageNavigation 및 PickleNavHost에서 GlobalNavEvent를 전달받도록 파라미터 수정 - SettingScreen에서 직접 수행하던 로그인 경로 이동 로직을 상위 NavHost로 위임
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 사용자 세션 만료를 앱 전반에 걸쳐 효율적으로 처리하기 위한 글로벌 이벤트 버스 시스템을 도입합니다. 토큰 갱신 실패 시 세션 만료 이벤트를 발행하고, MainActivity에서 이를 감지하여 사용자에게 스낵바 알림과 함께 로그인 화면으로 자동 전환되도록 합니다. 이를 통해 세션 관리 로직을 중앙화하고, 여러 화면에서 로그인 경로 이동 로직을 GlobalNavEvent를 통해 일관되게 처리하도록 리팩토링하여 앱의 안정성과 유지보수성을 향상시킵니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit릴리스 노트
Walkthrough도메인에 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 분 🚥 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📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Code Review
안녕하세요. 로그아웃 및 세션 만료 처리를 위해 GlobalNavEvent와 SessionEventBus를 도입하여 전역 이벤트를 처리하도록 개선한 점이 인상 깊습니다. 아키텍처 관점에서 관심사를 분리하고 코드의 응집도를 높이는 좋은 시도라고 생각합니다. 중점 리뷰 사항으로 요청주신 GlobalNavEvent 활용 방향은 적절하며, 앱의 전역적인 탐색 흐름을 관리하는 데 효과적인 패턴입니다. 코드의 완성도를 더욱 높이기 위해 몇 가지 제안 사항을 남깁니다.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/main/java/com/smtm/pickle/MainActivity.kt`:
- Around line 77-80: Replace the hardcoded Korean message passed to
GlobalNavEvent.SessionExpired in the LaunchedEffect block: move the string into
strings.xml (e.g., name it session_expired_message) and read it here via
stringResource(...) or context.getString(...) before calling
handleGlobalNavEvent; update the call inside
sessionEventBus.sessionExpired.collect so GlobalNavEvent.SessionExpired receives
the localized resource string instead of the literal.
In `@data/src/main/java/com/smtm/pickle/data/event/SessionEventBusImpl.kt`:
- Around line 12-15: SessionEventBusImpl currently uses a buffered Channel and
calls blocking _channel.send(Unit) inside emitSessionExpired, which can block
the OkHttp/auth thread; change the channel to a conflated channel
(Channel<Unit>(Channel.CONFLATED)) and replace the blocking send call in
emitSessionExpired with a non-blocking _channel.trySend(Unit) (optionally check
the result or ignore it), keeping sessionExpired = _channel.receiveAsFlow()
unchanged to deliver the latest idempotent signal without blocking.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 06f2d1c0-4cb0-437c-b348-92d736c56fb8
📒 Files selected for processing (8)
app/src/main/java/com/smtm/pickle/MainActivity.ktdata/src/main/java/com/smtm/pickle/data/di/DataModule.ktdata/src/main/java/com/smtm/pickle/data/event/SessionEventBusImpl.ktdata/src/main/java/com/smtm/pickle/data/source/remote/auth/TokenRefresher.ktdomain/src/main/java/com/smtm/pickle/domain/event/SessionEventBus.ktpresentation/src/main/java/com/smtm/pickle/presentation/mypage/navigation/MyPageNavigation.ktpresentation/src/main/java/com/smtm/pickle/presentation/navigation/PickleNavHost.ktpresentation/src/main/java/com/smtm/pickle/presentation/setting/SettingScreen.kt
- strings.xml: `global_session_expired` 문자열 추가 - MainActivity: 하드코딩된 세션 만료 메시지를 리소스 ID로 대체 - SessionEventBusImpl: Channel 타입을 `CONFLATED`로 변경하고 `trySend`를 사용하여 이벤트 처리 최적화
✨ 주요 변경 사항
✅ 체크리스트
🔍 중점 리뷰 사항
📸 스크린샷