[Fix/#308] CameraPreview 표시 중 Heartbeat 중복 처리를 방지한다.#309
Merged
YunDaeHyeon merged 1 commit intodevelopfrom Feb 5, 2026
Merged
Conversation
YunDaeHyeon
commented
Feb 5, 2026
Collaborator
Author
YunDaeHyeon
left a comment
There was a problem hiding this comment.
📄 PR Code Review Report
🔍 Summary
isMirroringDisconnected 상태 변화 시 특정 조건(showPreview)에 따라 화면 이탈 및 연결 해제 로직 실행 여부를 제어하는 변경 사항이 있습니다. 이는 특정 사용자 경험 흐름을 위한 의도적인 추가로 보이나, 상태 불일치 및 예기치 않은 동작 가능성에 대한 검토가 필요합니다.
⚠️ Key Issues
- 상태 불일치 위험:
isMirroringDisconnected가true로 변했지만showPreview가true인 상태일 경우browser.disconnect와router.pop()호출이 방지됩니다. 만약 이후showPreview가false로 변하더라도isMirroringDisconnected값이 다시 변경되지 않으면 연결 해제 로직 및 화면 전환이 누락되어 앱이 미러링이 해제된 상태에서 올바르게 정리되지 않거나 UI가 잘못된 상태를 표시할 수 있습니다.disconnect호출은 연결 해제 이벤트 발생 시 상태와 무관하게 항상 이루어져야 할 수도 있습니다.
🛠 Improvement Suggestions
isMirroringDisconnected가true가 되었을 때,showPreview상태와 관계없이browser.disconnect(useType: .mirroring)가 항상 호출되도록 로직을 분리하는 것을 고려해볼 수 있습니다.router.pop()은showPreview상태에 따라 조건부로 실행하더라도, 연결 해제 자체는 항상 처리하는 것이 앱의 안정성을 높일 수 있습니다.- 또는
showPreview가false로 변경될 때isMirroringDisconnected상태를 한 번 더 확인하여, 필요한 경우disconnect및pop이 이루어지도록 로직을 추가하여 잠재적인 상태 불일치를 해결하는 것을 고려할 수 있습니다.
✅ Positive Observations
- 특정 조건(
showPreview)에서 불필요한 화면 이탈을 방지하려는 의도는 명확하며, 잠재적인 사용자 경험 저하를 막기 위한 노력으로 보입니다.
sangYuLv
approved these changes
Feb 5, 2026
Collaborator
sangYuLv
left a comment
There was a problem hiding this comment.
AI 리뷰의 key issue는 넘어가도 될 듯 합니다!
showPreview가 false가 되는 건 촬영 완료 때만 있으니...
opficdev
approved these changes
Feb 5, 2026
- 하트비트 이벤트 발생 시 CameraPreview와 ConnectionCheckView가 동시에 반응하던 문제를 guard를 둬 해결
d9fa5ec to
507244e
Compare
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.
🔗 연관된 이슈
📝 작업 내용
📌 요약
CameraPreview의 알럿과 ConnectionCheckView의 pop이 동시에 동작하면서 알럿이 중복으로 출력되며
샤샤샥사라지는 버그를 해결했습니다.🔍 상세
문제 상황 재현을 위해 아래와 같이
시나리오를 산정했습니다.촬영기기(iPhone)에서 미러링 기기를 연결하거나 미러링/리모트 기기를 연결한 후ConnectionCheckView로 이동합니다.CameraPreview를fullScreenCover로 띄웁니다.연결을 끊습니다.CameraPreview에서 "연결이 끊어졌습니다." 알럿과 함께 홈으로 이동해야합니다.핵심 문제는
CameraPreview를fullScreenCover로 띄우면 ConnectionCheckView는dismiss되지 않고 그 아래에 살아있다는 점이었습니다.그러다보니
Heatbeat타임아웃 발생 시 브라우저의 모든 이벤트 스트림을 관리하는BrowserStreamManager가 모든 하트비트 스트림에.heartbeatTimeout이벤트를 방출합니다.이때, ConnectionCheckStore와 CameraPreviewStore가
동시에 이벤트를 수신해서 문제가 발생되고 있었습니다.isMirroringDisconnected를true로 변경하여 View에서router.pop()실행isMirroringDisconnected를true로 변경하여 알럿 표시 후router.reset()실행이렇게 동시에 이벤트를 수신해버리니
CamerePreview의 알럿은 잠깐 보였다가 fullScreenCorver가 dismiss되면서 슈슈슉 사라집니다. 동시에ConnectionCheckView의router.pop도 실행되어 BrowsingView로 돌아가버려 네비게이션의 충돌이 발생하고 있었습니다.이를 해결하기 위해 간단히
guard문을 추가하여ConnectionCheckView가CamerePreview를 표시하고 있을 때는Heartbeat반응을 건너뛰도록 했습니다.📸 영상 / 이미지 (Optional)
개선 전
2.mov
개선 후
2.mov