fix: Android 카메라 호출 후 앱 kill 시 WebView URL 복원#2
Merged
Conversation
카메라 호출 전 현재 URL을 SharedPreferences에 저장하고, 앱이 메모리 부족으로 kill되었다 재시작될 때 저장된 URL로 복원합니다. iOS는 이 문제가 없어 Android 전용 기능입니다. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Android에서 카메라 호출 시 메모리 부족으로 앱이 kill되면 WebView URL이 초기화되는 문제를 SharedPreferences를 이용해 해결하는 PR입니다.
주요 변경사항:
UrlRestoreManager를 통한 URL 저장/복원 로직 추가 (5분 유효 시간)- 카메라 호출 전 현재 URL 저장, 앱 재시작 시 복원
- Android 전용 기능으로 Platform 분기 처리
우려되는 점:
- URL 삭제 후 유효 시간 체크로 인한 로직 오류
- 카메라 취소 시 URL 미삭제로 인한 잘못된 복원 가능성
- 스플래시 화면 초기화 에러 시 앱이 멈출 수 있는 시나리오
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/utils/url_restore_manager.dart | URL 저장/복원 매니저 신규 추가 (Android 전용, 5분 유효 시간) |
| lib/main.dart | 앱 시작 시 복원 URL 확인 및 WebView 초기화 로직 수정 |
| lib/web_view/web_view.dart | initialUrl 파라미터 추가하여 복원 URL 지원 |
| lib/bridge/web_view_bridge_handler.dart | 카메라 호출 전 URL 저장 및 완료/에러 시 정리 로직 추가 |
| pubspec.yaml | shared_preferences 의존성 추가 |
| pubspec.lock | shared_preferences를 direct main dependency로 변경 |
- consumeRestoredUrl()에서 유효 시간 체크 순서 수정 - SplashScreen 초기화 시 try-catch 에러 처리 추가 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
테스트
스크린샷 (UI 변경 시)
N/A
관련 이슈