feat(analysis): 분석 실패 단계 노출 + Supabase 진단 로그 수집 - #42
Merged
Conversation
[analysis_trim_page] - 실패 지점 6개가 "분석 중 문제가 발생했어요" 하나로 뭉개져 TestFlight에서 원인 파악이 불가능했다. 단계 라벨(영상 자르기/첫 프레임 추출/레인 검출/ 호모그래피 계산/분석 파이프라인)을 스낵바에 표기 - 스낵바 "자세히" 액션에서 예외+스택을 SelectableText로 확인 가능 (내부 QA용, 공개 배포 전 제거) - ffmpeg 실패 시 returnCode만으론 원인을 알 수 없어 로그 마지막 12줄을 예외 메시지에 첨부 [pubspec] - TestFlight 재업로드용 빌드번호 1.3.0+7
TestFlight엔 콘솔이 없어 파이프라인이 뱉는 진단(debugPrint)이 전부 사라진다. 실패 원인 추적과 구속 표본 축적을 동시에 해결한다. [core] - DebugLogBuffer — debugPrint를 감싸 최근 400줄 링 버퍼에 적재. dump()는 절단 시 tail 보존(실패 직전 줄이 가장 중요) - main에서 install(). 중복 install 시 래퍼 중첩 방지 [analysis] - AnalysisDebugLogService — 분석 1회당 analysis_debug_logs에 한 행. 업로드 예외는 전부 삼킨다(진단 수집이 분석을 깨면 안 됨) - 성공/실패 양쪽 기록. 성공 시 랜드마크·기존 구속 두 값과 궤적 소스, 검출 프레임 수를 metrics(jsonb)로 남겨 표본을 쌓는다 - 트림 시작 시 버퍼 clear — 직전 세션 로그 혼입 방지 [supabase] - migrations/20260730_analysis_debug_logs.sql — 테이블 + RLS(본인 행만 insert/select). 대시보드 SQL Editor에서 수동 적용 필요 [pubspec] - package_info_plus 추가 (앱 버전 기록용, 기존 settings_page의 미선언 의존성도 함께 해소) - 존재하지 않고 참조도 없는 assets/videos/ 항목 제거
devpark435
marked this pull request as ready for review
July 30, 2026 07:11
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.
문제
분석 실행 시 "분석 중 문제가 발생했어요"만 반복 표시.
_startAnalysis()의 단일 catch가 실패 지점 6개를 하나의 메시지로 뭉갬. TestFlight엔 콘솔이 없어debugPrint진단도 전부 사라짐.변경
1. 실패 단계 노출
[영상 자르기|첫 프레임 추출|레인 검출|호모그래피 계산|분석 파이프라인] 단계에서 실패했어요2. Supabase 진단 로그
DebugLogBuffer—debugPrint를 감싸 최근 400줄 적재. 절단 시 tail 보존AnalysisDebugLogService— 분석 1회당analysis_debug_logs에 한 행. 업로드 예외는 전부 삼킴landmark_speed_kmh/legacy_speed_kmh/speed_source/trajectory_source/ 검출 프레임 수를metrics(jsonb)로 축적 → 구속 정확도를 표본 1개가 아닌 분포로 판단3. 부수
package_info_plus정식 의존성 추가 (기존settings_page미선언 의존성도 해소)assets/videos/pubspec 항목 제거DB
analysis_debug_logs테이블 적용 완료 (2026-07-30). 11컬럼, RLS on, 본인 행만 insert/select하는 정책 2개, 인덱스 2개. 보안 어드바이저에 이 테이블 관련 경고 없음.SQL은
supabase/migrations/20260730_analysis_debug_logs.sql에 기록용으로 보관 (재실행 안전).검증
flutter analyze lib/— 신규 파일 0 issues (기존 7건은 무관한 선행 이슈)flutter test test/core/services/debug_log_buffer_test.dart— 7 passedflutter test test/features/analysis— 210 passedflutter test전체 —test/widget_test.dart1건 실패. 선행 이슈: 스모크 테스트가Supabase.initialize없이BowlingDiaryApp을 pump해_instance._isInitializedassertion. 이번 변경과 무관하며 손대지 않음제거 대상 (공개 배포 전)
QA 뱃지 · 진단 필드 ·
DebugLogBuffer·AnalysisDebugLogService·analysis_debug_logs테이블