Skip to content

인물 합치기 완료 후 뒤로가기 시 빈 화면이 노출되는 이슈를 해결한다#60

Merged
komodgn merged 1 commit intodevelopfrom
fix/#59
Jan 6, 2026
Merged

인물 합치기 완료 후 뒤로가기 시 빈 화면이 노출되는 이슈를 해결한다#60
komodgn merged 1 commit intodevelopfrom
fix/#59

Conversation

@komodgn
Copy link
Owner

@komodgn komodgn commented Jan 6, 2026

isInitialized 플래그 도입

테스트 영상

- 인물 합치기 완료 후 뒤로가기 시 빈 화면이 노출되는 이슈 해결 (isInitialized 플래그 도입)
@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

PersonDetailPresenter.kt now includes a LaunchedEffect lifecycle handler that tracks initialization state. When the person object becomes non-null, it sets an internal flag; when person becomes null after initialization with no active loading, it automatically navigates back using the navigator.

Changes

Cohort / File(s) Summary
Lifecycle initialization tracking
feature/detail/src/main/java/com/example/metasearch/feature/detail/person/PersonDetailPresenter.kt
Added LaunchedEffect that observes person state changes; sets isInitialized flag when person transitions to non-null; triggers navigation back when person becomes null post-initialization and isLoading is false. Added new internal state variable isInitialized (initially false) and LaunchedEffect import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • komodgn/meta-android#31: Introduces or manages the person state that this LaunchedEffect observes and depends on for its lifecycle tracking logic.

Poem

🐰 A rabbit hops through state transitions true,
Watching person flow from old to new,
When null returns and loading's through,
Back we pop—initialization clue!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main issue being fixed: showing a blank screen when navigating back after completing a person merge operation.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

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

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
feature/detail/src/main/java/com/example/metasearch/feature/detail/person/PersonDetailPresenter.kt (1)

127-134: Add error handling to ensure isLoading is always reset.

If savePersonInfo() throws an exception, isLoading will remain true indefinitely, leaving the UI stuck in a loading state.

🔎 Proposed fix
                 PersonDetailUiEvent.OnConfirmMergeSave -> {
                     scope.launch {
-                        isLoading = true
-                        savePersonInfo()
-                        showMergeConfirmDialog = false
-                        isLoading = false
+                        try {
+                            isLoading = true
+                            savePersonInfo()
+                            showMergeConfirmDialog = false
+                        } finally {
+                            isLoading = false
+                        }
                     }
                 }
🤖 Fix all issues with AI Agents
In
@feature/detail/src/main/java/com/example/metasearch/feature/detail/person/PersonDetailPresenter.kt:
- Around line 68-74: The LaunchedEffect in PersonDetailPresenter currently only
keys on person so it won't re-run when isLoading flips, causing a race where
person becomes null during loading and navigator.pop() never runs; update the
LaunchedEffect to key on both person and isLoading (e.g., LaunchedEffect(person,
isLoading)) and keep the existing logic that sets isInitialized when person !=
null and calls navigator.pop() when person == null && isInitialized &&
!isLoading so the effect will re-evaluate after the merge at the code altering
isLoading (the merge around lines 129-132) and correctly navigate away.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed08373 and 0cb9144.

📒 Files selected for processing (1)
  • feature/detail/src/main/java/com/example/metasearch/feature/detail/person/PersonDetailPresenter.kt
⏰ 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). (1)
  • GitHub Check: ci-build
🔇 Additional comments (1)
feature/detail/src/main/java/com/example/metasearch/feature/detail/person/PersonDetailPresenter.kt (1)

66-66: Good approach using an initialization flag.

The isInitialized flag effectively distinguishes between "person hasn't loaded yet" (initial null) and "person was deleted/merged" (null after being non-null), preventing premature navigation during initial load.

Comment on lines +68 to +74
LaunchedEffect(person) {
if (person != null) {
isInitialized = true
} else if (isInitialized && !isLoading) {
navigator.pop()
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

LaunchedEffect must also key on isLoading to prevent race condition.

The effect only triggers when person changes, not when isLoading changes. If the person becomes null while isLoading is true (during the merge at lines 129-132), the navigation check will fail. When isLoading later becomes false, the effect won't re-trigger, leaving the user on an empty screen—the exact issue this PR aims to fix.

🔎 Proposed fix
-        LaunchedEffect(person) {
+        LaunchedEffect(person, isLoading) {
             if (person != null) {
                 isInitialized = true
             } else if (isInitialized && !isLoading) {
                 navigator.pop()
             }
         }
🤖 Prompt for AI Agents
In
@feature/detail/src/main/java/com/example/metasearch/feature/detail/person/PersonDetailPresenter.kt
around lines 68 - 74, The LaunchedEffect in PersonDetailPresenter currently only
keys on person so it won't re-run when isLoading flips, causing a race where
person becomes null during loading and navigator.pop() never runs; update the
LaunchedEffect to key on both person and isLoading (e.g., LaunchedEffect(person,
isLoading)) and keep the existing logic that sets isInitialized when person !=
null and calls navigator.pop() when person == null && isInitialized &&
!isLoading so the effect will re-evaluate after the merge at the code altering
isLoading (the merge around lines 129-132) and correctly navigate away.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Android CI Summary

Step Results:

  • Debug Build: ✅ Success (3m 39s)
  • Code Style Check: ✅ Success (3m 47s)

Total Time: 7m 26s

🎉 All steps completed successfully!

@komodgn komodgn merged commit 7234b52 into develop Jan 6, 2026
2 checks passed
@komodgn komodgn deleted the fix/#59 branch January 6, 2026 15:14
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

Comments