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

fix: 간헐적으로 스타카토 생성/수정 액티비티가 종료되는 버그 #586

Open
2 tasks done
s6m1n opened this issue Jan 10, 2025 · 0 comments
Open
2 tasks done
Assignees
Labels
android We are android>< fix 버그 (버그 수정)

Comments

@s6m1n
Copy link
Member

s6m1n commented Jan 10, 2025

🤮 As Is (오마이갓 비상사태)

lateinit property has not been initialized
private lateinit var address: String 프로퍼티가 초기화 되기 전에 호출되며 액티비티가 종료되는 버그 발생

image
    private fun fetchAddress(location: Location) {
        lifecycleScope.launch {
            val defaultDelayJob =
                launch {
                    delay(500L)
                }
            val getCurrentLocationJob =
                launch {
                    updateAddressByCurrentAddress(location)
                }
            getCurrentLocationJob.join()
            defaultDelayJob.join()
            viewModel.setPlaceByCurrentAddress(address, location) // -> 이 부분에서 발생
        }
    }

원인

코드 순서 상 updateAddressByCurrentAddress(location)에서 프로퍼티가 초기화된 후 viewModel.setPlaceByCurrentAddress(address, location) 라인이 호출되고 있는데
has not been initialized가 왜 발생하는지 모르겠네요.. 원인을 좀 더 살펴보겠습니다.

😇 이때까지 끝낼게요!

우선 까먹지 않도록 이슈 먼저 올려놓고 현재 열려있는 PR 머지 후 가장 우선적으로 수정하겠습니다.

@s6m1n s6m1n added the fix 버그 (버그 수정) label Jan 10, 2025
@s6m1n s6m1n self-assigned this Jan 10, 2025
@s6m1n s6m1n added the android We are android>< label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android We are android>< fix 버그 (버그 수정)
Projects
Status: No status
Development

No branches or pull requests

1 participant