Skip to content

Conversation

@2paperstar
Copy link
Member

@2paperstar 2paperstar commented Nov 6, 2025

  • chore(deps): add logging
  • feat: don't log at crashlytics on debug mode
  • fix: don't set initial user subject value
  • fix: redirect to injected link in splash page

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 외부 링크 기반 조건부 네비게이션 처리 추가
  • 개선 사항

    • 디버그 모드에서 향상된 에러 로깅 활성화
    • 내부 상태 관리 안정성 개선

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

📝 Walkthrough

Walkthrough

OAuth 저장소의 BehaviorSubject 초기화 및 사용자 스트림 동작을 변경하고, 디버그 모드에서 조건부 로깅을 추가하며, LinkBloc 상태 접근을 위한 게터를 추가하고, 스플래시 페이지의 네비게이션 로직에 LinkBloc을 통합하며, logging 의존성을 추가합니다.

Changes

Cohort / File(s) 요약
OAuth 저장소 상태 관리
lib/app/modules/auth/data/repositories/oauth_rest_auth_repository.dart
BehaviorSubject 초기화를 시드 없는 형태로 변경하고, 사용자 스트림 게터가 값이 존재할 때만 방출하도록 수정
조건부 로깅 및 디버깅
lib/app/modules/common/presentation/utils/log.dart
디버그 모드에서 Dart 개발자 로그를 사용하고 프로덕션에서는 Firebase Crashlytics를 사용하는 조건부 에러 로깅 추가; dart:developer, flutter/foundation.dart, logging.dart 임포트 추가
LinkState 공개 인터페이스
lib/app/modules/core/presentation/bloc/link_bloc.dart
LinkState에 프라이빗 생성자(const LinkState.\_())와 두 개의 공개 게터(hasLink, link) 추가
스플래시 페이지 네비게이션
lib/app/modules/splash/presentation/pages/splash_page.dart
LinkBloc에서 상태를 읽고, 링크가 비어있지 않으면 라우터를 통해 해당 링크를 푸시한 후 기존 초기화 흐름 계속 진행
의존성 추가
pubspec.yaml
logging 의존성(^1.3.0) 추가

Sequence Diagram

sequenceDiagram
    participant SplashPage
    participant LinkBloc
    participant Router
    participant AppVersionBloc
    
    SplashPage->>LinkBloc: initState에서 상태 조회
    LinkBloc-->>SplashPage: LinkState 반환
    
    alt link이 비어있지 않음
        SplashPage->>Router: link 푸시
        Router-->>SplashPage: 성공
    end
    
    SplashPage->>Router: ListRoute로 모든 라우트 교체
    SplashPage->>AppVersionBloc: 초기화
    SplashPage->>SplashPage: 스플래시 제거
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • 주의 깊게 검토할 영역:
    • oauth_rest_auth_repository.dart의 BehaviorSubject 초기화 변경이 기존 구독자 동작에 미치는 영향 확인 필요
    • log.dart의 조건부 로깅 로직이 모든 에러 경로에서 올바르게 작동하는지 검증
    • splash_page.dart의 새로운 네비게이션 흐름이 기존 라우팅 로직과 충돌하지 않는지 확인
    • link_bloc.dart의 새로운 게터가 모든 LinkState 변형을 올바르게 처리하는지 검토

Possibly related PRs

  • fix: check login cancel router resolved #309: 동일한 로깅 유틸리티(lib/app/modules/common/presentation/utils/log.dart)를 수정하여 디버그 모드 로깅을 추가하고, 라우터에서 로깅 유틸리티를 호출합니다.
  • feat: crashlytics #210: 동일한 로깅 유틸리티(lib/app/modules/common/presentation/utils/log.dart)를 수정하여 조건부 디버그 로깅 및 Crashlytics 에러 보고 기능을 추가합니다.
  • feat: fcm setting #148: 동일한 파일(lib/app/modules/core/presentation/bloc/link_bloc.dart)을 수정하여 LinkBloc 및 LinkState를 도입했습니다.

Poem

🐰 링크는 날개를 달고, 상태는 숨을 쉬고,

로그는 밤을 밝히네 디버그의 손끝에서,

스플래시 위로 경로 그으며 흐르는 데이터,

BehaviorSubject는 조용히 변화하고,

모두 함께 춤춘다, 완벽한 조화 속에! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 splash page에서 injected link로 redirect하는 기능을 명확하게 설명하며, raw_summary의 splash_page.dart 변경사항과 일치합니다.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
Contributor

@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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2263d41 and f2b17fc.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • lib/app/modules/auth/data/repositories/oauth_rest_auth_repository.dart (2 hunks)
  • lib/app/modules/common/presentation/utils/log.dart (2 hunks)
  • lib/app/modules/core/presentation/bloc/link_bloc.dart (1 hunks)
  • lib/app/modules/splash/presentation/pages/splash_page.dart (2 hunks)
  • pubspec.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 7
File: lib/app/modules/main/presentation/pages/main_page.dart:29-46
Timestamp: 2025-04-03T08:06:18.795Z
Learning: In this PR (#7), the main_page.dart file is not the focus of the changes but rather demonstrates the usage of the implemented common components (PotGButton, PotGToggle, etc.).
📚 Learning: 2025-04-03T08:06:18.795Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 7
File: lib/app/modules/main/presentation/pages/main_page.dart:29-46
Timestamp: 2025-04-03T08:06:18.795Z
Learning: In this PR (#7), the main_page.dart file is not the focus of the changes but rather demonstrates the usage of the implemented common components (PotGButton, PotGToggle, etc.).

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-05-16T12:34:42.880Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 24
File: lib/app/router.dart:10-19
Timestamp: 2025-05-16T12:34:42.880Z
Learning: In gsainfoteam/pot-g-flutter, the router configuration needs to explicitly define all four distinct child routes to match the tabs in MainBottomNavigationPage to ensure proper synchronization with AutoTabsRouter. This change is planned to be implemented in a future PR.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-05-16T12:35:04.390Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 24
File: lib/app/modules/main/presentation/pages/main_bottom_navigation_page.dart:21-24
Timestamp: 2025-05-16T12:35:04.390Z
Learning: In the MainBottomNavigationPage of gsainfoteam/pot-g-flutter project, the routes list currently contains EmptyRoute and MainRoute instances that don't match the router configuration. The developer plans to add the missing routes in a future update to properly sync the tabs with router definitions.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-10-05T11:03:42.796Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 82
File: lib/app/modules/chat/presentation/pages/chat_room_page.dart:105-113
Timestamp: 2025-10-05T11:03:42.796Z
Learning: The chat room page (ChatRoomPage) in gsainfoteam/pot-g-flutter cannot be accessed by unauthenticated users, so AuthBloc.userOf(context) will not return null in that context.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-11-01T02:28:39.838Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 247
File: lib/app/pot_app.dart:90-129
Timestamp: 2025-11-01T02:28:39.838Z
Learning: In gsainfoteam/pot-g-flutter, PotListBloc maintains user-agnostic state - the pot list is the same for all users regardless of authentication status, so clearing its state on logout is not necessary.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-11-04T06:44:47.099Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 296
File: lib/app/router.dart:34-35
Timestamp: 2025-11-04T06:44:47.099Z
Learning: In gsainfoteam/pot-g-flutter router guard (lib/app/router.dart), when redirecting to ConsentRoute using resolver.redirectUntil with an empty onDone callback, navigation continues through automatic guard reevaluation after consent completion. When the guard reevaluates, user.agreedTerms.allRequired becomes true and resolver.next(true) is called, allowing the navigation to proceed. The empty onDone callback allows the calling page (e.g., main_bottom_navigation_page) to handle tab restoration logic rather than forcing immediate navigation.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-10-05T11:04:45.955Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 82
File: lib/app/modules/chat/presentation/bloc/chat_bloc.dart:11-43
Timestamp: 2025-10-05T11:04:45.955Z
Learning: In gsainfoteam/pot-g-flutter, ChatBloc instances are recreated when the pot changes, so using `late final PotEntity _pot` is safe as each bloc instance only receives one ChatInit event during its lifecycle.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-10-21T13:24:30.054Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 235
File: lib/app/modules/auth/presentation/pages/login_page.dart:31-39
Timestamp: 2025-10-21T13:24:30.054Z
Learning: In the pot-g-flutter codebase, widget lifecycle management (mounted checks) for callbacks passed to LoginPage is handled at the parent/caller level rather than within LoginPage itself. Therefore, mounted checks before calling widget.onCancel(), widget.onDone(), and widget.onConsent() in LoginPage are not required.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-10-09T23:55:55.441Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 151
File: lib/app/modules/list/presentation/widgets/pot_list_item.dart:109-110
Timestamp: 2025-10-09T23:55:55.441Z
Learning: In Flutter, BlocListener's listener callback is synchronous and executes immediately when state changes occur. Mounted checks are not required in synchronous BlocListener callbacks unless there are explicit await operations within the callback.

Applied to files:

  • lib/app/modules/splash/presentation/pages/splash_page.dart
📚 Learning: 2025-09-22T04:49:13.008Z
Learnt from: 2paperstar
Repo: gsainfoteam/pot-g-flutter PR: 70
File: lib/app/modules/device/data/repositories/flutter_secure_storage_device_info_repository.dart:1-5
Timestamp: 2025-09-22T04:49:13.008Z
Learning: In Flutter device ID repositories using secure storage, race conditions can occur during initial device ID generation when multiple concurrent calls try to create and store different UUIDs. The proper solution involves using a Mutex to protect the read-check-write sequence, implementing memory caching to avoid repeated storage access, and defensive programming to handle null/empty values. The pattern: check cache → mutex.protect(async { read from storage → if null/empty generate new → write to storage → update cache }) effectively prevents race conditions.

Applied to files:

  • lib/app/modules/common/presentation/utils/log.dart
⏰ 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). (2)
  • GitHub Check: Build Android App and Test
  • GitHub Check: Build iOS App and Test

@2paperstar 2paperstar merged commit 781a3cb into gsainfoteam:development Nov 6, 2025
5 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