[Feat] 오프라인 캐시 Remote Config 플래그 추가 #582 - #595
Merged
Merged
Conversation
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.
#️⃣연관된 이슈
Closes #582
📝작업 내용
오프라인 캐시 경로를 원격에서 켜고 끄는 플래그를 추가했습니다. 설계 문서 롤백 절의 수단입니다.
RemoteConfigKeys.OFFLINE_CACHE_ENABLED = "offline_cache_enabled". 기존 키 두 개와 같은 소문자 snake_case입니다remote_config_defaults.xml에offline_cache_enabled = false. 인앱 기본값과 콘솔 기본값을 같게 두라는 이슈 항목을 따랐습니다. fetch에 실패하면 기본값이 읽히므로 기본값이 곧 최악 상황의 동작이고, 꺼짐이면 최악이 "기존과 동일"입니다FeatureFlagDataSource신설.firebaseRemoteConfig.getBoolean()한 줄이고@Singleton+@Inject생성자라 DI 모듈이 필요 없습니다fetch는 따로 하지 않습니다. 앱 진입의
AppUpdateRepositoryImpl.getUpdateInfo()가 이미fetchAndActivate()를 호출하고 실패해도 캐시와 기본값으로 진행하므로, 이 플래그는 활성화된 값만 읽습니다. 이슈의 "기존 Remote Config fetch 흐름에 얹어 읽기"를 그렇게 해석했습니다.Firebase 콘솔 작업도 함께 했습니다.
undabang) 프로젝트 Remote Config에offline_cache_enabled파라미터를 BOOLEAN false로 발행했습니다. 템플릿 버전 25입니다undabang-prod)는 아직 발행하지 않았습니다. 배포 준비 단계에서 함께 올립니다스크린샷 (선택)
UI 변경이 없습니다.
💬리뷰 요구사항(선택)
이슈 항목 하나를 다르게 판단했습니다. "domain에서 읽을 수 있는 형태로 노출(UseCase로 둘지 Repository 함수로 둘지 PR에서 선택)"인데, 둘 다 두지 않고 data 내부에 뒀습니다.
플래그를 읽는 쪽이 화면이 아니라 Repository입니다. #584와 #587의 "플래그가 꺼져 있으면 기존 네트워크 경로 유지"는
ExerciseRecordRepositoryImpl과TimerRepositoryImpl안의 분기이고, data는 UseCase를 호출할 수 없습니다. domain에 인터페이스를 만들면 소비자가 없는 코드가 됩니다. 화면이 플래그를 알아야 하는 요구가 생기면 그때 domain으로 올리는 편이 낫다고 봤습니다. 반대 의견이면FeatureFlagRepository와 UseCase를 추가하겠습니다.이 이슈에서 확인할 수 없는 항목이 둘 있습니다. "꺼짐일 때 기존 네트워크 경로 그대로"와 "비행기 모드 첫 실행에서 기본값 동작"입니다. 플래그를 읽는 소비 지점이 아직 없어 관찰할 지점이 없습니다. 이슈 본문도 "소비 지점이 생기는 후속 이슈에서 재확인"으로 적혀 있어 #584에서 확인합니다.
작업 중에 dev 템플릿에서 두 가지를 봤습니다. 이 PR에서는 건드리지 않았습니다.
new_feautre_flag(오타 포함) 파라미터가 BOOLEAN true로 남아 있는데 앱 소스에서 참조가 없습니다. 정리 대상으로 보입니다latest_version_code와min_required_version_code가valueType: STRING인데 앱은getBoolean이 아니라getLong()으로 읽습니다. Remote Config가 변환해 주므로 동작하지만 타입이 어긋나 있습니다