Skip to content
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

일부 기기에서 TransactionTooLargeException 발생하는 이슈 #673

Merged
merged 2 commits into from
Nov 19, 2023

Conversation

ricky-o-k
Copy link
Collaborator

@ricky-o-k ricky-o-k commented Oct 29, 2023

문제

  1. container savedStateHandle 처리 시 데이터가 bundle extra 형태로 캐싱됨
  2. 갤러리 목록을 state 로 관리하고 있어, 사진 엄청 많은 안드로이드 폰의 경우 배열 10000 도 훌쩍 넘음

-> 위 2개 이슈가 겹쳐 문제 발생 (extra 제한이 걸려 크래시가 발생)

로그 확인 내용

// 맨 뒤에 cont 는 너무 많아서 줄임표시된 것

androidx.lifecycle.BundlableSavedStateRegistry.key -> "Bundle[{androidx.lifecycle.internal.SavedStateHandlesProvider=Bundle[{}], android:support:activity-result=Bundle[{KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT=java.util.Random@d0358f9, KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS=[], KEY_COMPONENT_ACTIVITY_REGISTERED_RCS=[], KEY_COMPONENT_ACTIVITY_PENDING_RESULT=Bundle[{}], KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS=[]}], androidx.lifecycle.ViewModelProvider.DefaultKey:team.duckie.app.android.feature.onboard.viewmodel.OnboardViewModel=Bundle[{values=[true, OnboardState(step=Login, me=User(id=32, nickname=테스트., profileImageUrl=http://k.kakaocdn.net/dn/dpk9l1/btqmGhA2lKL/Oz0wDuJn1YV2DIn92f6DVK/img_640x640.jpg, status=NEW, duckPower=null, follow=null, favoriteTags=[], favoriteCategories=[], permissions=[], introduction=null), finishOnboarding=false, profileState=NicknameDuplicateError, temporaryNickname=null, temporaryProfileImageFile=null, galleryImages=[content://media/external/images/media/1000000436, content://media/external/images/media/1000000435, cont"

해결

  • container savedStateHandle 처리 시 크래시, 백그라운드 종료되도 데이터가 남지만 ( = 데이터가 캐싱되지만)
    너무 데이터가 많은 경우 위 현상이 발생합니다.
    (허들로 이야기했지만 문자열 만으로도 1MB 가 넘을 수 있습니다.)
  • 이런 경우 Preference 로도 처리할 수 있겠지만, 덕키 앱에선 그럴 필요는 없어보여 이렇게 처리했습니다.

기타

  • 온보딩 시 데이터 캐싱이 있으면 좋긴해서 TODO 로 관련 내용 남겨놓았습니다.
  • MVI + orbit state 에 과도한 데이터를 넣지 않도록 주의가 필요해 보입니다.

@ricky-o-k ricky-o-k self-assigned this Oct 29, 2023
@ricky-o-k
Copy link
Collaborator Author

논의된 내용이라 merge 합니다.

@ricky-o-k ricky-o-k merged commit 5575ad6 into develop Nov 19, 2023
@ricky-o-k ricky-o-k deleted the login_activity_error branch November 19, 2023 10:47
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