[FIX] 링크 검사 polling 20초 초과 시 강제 중단 처리#73
Merged
Conversation
Contributor
Author
|
추가 수정 사항이 있어 수정하였습니다! 정상 검사 결과가 도착해서 결과 화면으로 이동하는 시점과, 검사 화면의 20초 watchdog timeout이 거의 동시에 실행될 수 있는 레이스 케이스를 보완했습니다. 기존에는 이를 막기 위해
이렇게 해서 PR 의도였던 “정상 결과 화면 이동 시 timeout 에러 상태가 뒤늦게 반영되지 않도록 방어”가 애니메이션 watchdog 쪽에도 적용되도록 했습니다. |
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 #67
개요
링크 검사 중 화면의 최대 대기 시간을 20초로 조정하고, 20초를 초과하면 재검사 가능한 상태로 전환되도록 timeout 처리를 강화했습니다.
기존
app/(tabs)/(home)/scanning.tsx에는MAX_POLLING_MS = 30_000기준의 polling 제한이 있었지만, 실제 휴대폰 테스트 중 검사 결과 화면을 여러 번 거치고 뒤로가기를 반복하는 상황에서보안 검사 중입니다애니메이션이 무한히 도는 문제가 발생했습니다.이 문제는 단순히 polling 요청 시작 시점 기준 timeout만으로는 충분히 막기 어려웠습니다. 중복 검사나 뒤로가기 흐름으로 오래된
scanning화면이 다시 보이는 경우, 사용자 입장에서는 애니메이션이 계속 도는 화면을 보고 있지만 기존 polling timeout 관리 흐름은 이미 정리되었거나 기대한 run과 분리될 수 있기 때문입니다.따라서 이번 작업에서는 기준을 이중화했습니다.
polling/request 기준 20초 timeout
분석 요청과 polling loop 자체가 20초를 넘지 않도록 제한합니다.
화면/애니메이션 기준 20초 watchdog
화면이 focus되어 있고 Lottie 애니메이션이 도는 상태가 되면, polling 상태와 관계없이 20초 후 반드시 timeout 상태로 전환합니다.
이를 통해 API 요청, polling, 네비게이션 상태가 꼬이더라도 사용자가 검사 중 애니메이션 화면에서 20초 이상 무한 대기하지 않도록 보완했습니다.
주요 구현 내용
MAX_POLLING_MS = 30_000제거SCAN_SCREEN_TIMEOUT_MS = 20_000추가AbortController.abort()로 정리검사를 완료하지 못했어요,다시 검사,돌아가기표시파일별 역할
app/(tabs)/(home)/scanning.tsx: polling timeout, 화면 단위 timeout, 애니메이션 visible watchdog, abort/cleanup, 늦은 결과 이동 방어 처리해결한 이슈 목록
app/(tabs)/(home)/scanning.tsx의 현재 polling 흐름 확인MAX_POLLING_MS = 30_000기준 제거20_000ms기준으로 통일SCAN_SCREEN_TIMEOUT_MS상수로 분리POST /api/v1/analyses가 지연되는 경우에도 20초 후 timeout 처리GET /api/v1/analyses/{analysisId}polling이 지연되는 경우에도 20초 후 timeout 처리AbortController.abort()로 진행 중인 요청 정리검사를 완료하지 못했어요문구와다시 검사버튼 표시다시 검사버튼을 누르면 기존 URL로 새 검사가 재시작되도록 기존 retry 흐름 유지체크 사항
참고사항
scanning화면이 다시 보이는 상황을 완전히 방어하기 어렵기 때문입니다.Screenshots or Video