Files
sodalive-ios/docs/20260313_커뮤니티댓글알림딥링크포스트아이디처리.md

8.6 KiB

20260313 커뮤니티 댓글 알림 딥링크 포스트아이디 처리

작업 목표

  • 딥링크 패턴 $uriScheme://community/$creatorId?postId=$postId 입력 시, 해당 크리에이터 커뮤니티로 이동한 뒤 postId의 댓글 리스트를 즉시 노출한다.
  • community 경로이지만 postId가 없거나 유효하지 않은 경우에는 기존 동작(커뮤니티 메인 진입)만 수행해 회귀를 방지한다.
  • 외부 딥링크, 푸시 탭, 알림 리스트 탭, 콜드 스타트(스플래시 대기 처리) 모두에서 동일한 결과를 보장한다.

사전 조사 요약

구현 범위 (예상 변경 파일)

  • SodaLive/Sources/App/AppDeepLinkHandler.swift
    • community 라우트에서 creatorId + postId를 함께 파싱하도록 액션/파서 확장.
  • SodaLive/Sources/App/AppState.swift
    • 커뮤니티 댓글 딥링크 후속 처리용 pending 상태(예: creatorId/postId) 추가 및 소비 지점 정의.
  • SodaLive/Sources/Splash/SplashView.swift
    • 콜드 스타트 시 pending 딥링크를 main 진입 후 안정적으로 적용하도록 실행 순서 점검/보정.
  • SodaLive/Sources/Explorer/Profile/CreatorCommunity/All/CreatorCommunityAllViewModel.swift
    • 딥링크 postId를 리스트에서 해석해 isShowSecret 계산 및 댓글 시트 오픈 조건을 준비.
  • SodaLive/Sources/Explorer/Profile/CreatorCommunity/All/CreatorCommunityAllView.swift
    • 커뮤니티 진입 직후 pending postId를 반영해 댓글 시트를 자동 노출.

구현 체크리스트

  • AppDeepLinkAction에 커뮤니티 댓글 진입을 표현할 수 있는 케이스(또는 동일 효과의 payload)를 정의한다.
  • AppDeepLinkHandler.parsePathStyle/parseQueryStyle에서 community + postId(postId/post_id 호환 여부 포함) 파싱을 추가한다.
  • community 경로 파싱 시 creatorId 유효성(양수)과 postId 유효성(양수)을 분리 검증한다.
  • postId가 유효하지 않을 때는 기존 .creatorCommunityAll(creatorId:) 이동만 수행하도록 회귀 안전 분기를 둔다.
  • AppState에 커뮤니티 댓글 딥링크 pending 저장/소비 API를 추가한다.
  • 스플래시 구간에서 pending 딥링크가 유실되지 않도록 SplashView.nextAppStep() 적용 순서를 점검한다.
  • CreatorCommunityAllView 진입 시 pending postId를 감지하고 viewModel.postId를 설정한다.
  • CreatorCommunityAllViewModel에서 postId 대상 게시글의 시크릿 댓글 조건(price, existOrdered, 작성자 여부)을 계산한다.
  • 리스트 로딩 시점 이슈(첫 페이지 미포함)에 대한 보완 정책(추가 페이징 또는 실패 시 일반 진입)을 정의한다.
  • 알림 리스트 탭(source: .notificationList)과 외부 딥링크(source: .external) 모두에서 동일 시나리오를 수동 QA한다.
  • 영향 파일 lsp_diagnostics 실행 후 빌드/테스트 명령 결과를 문서 하단 검증 기록에 누적한다.

수용 기준

  • $uriScheme://community/{creatorId}?postId={postId} 실행 시 커뮤니티 화면 진입 후 댓글 리스트가 자동으로 열린다.
  • $uriScheme://community/{creatorId} 또는 postId 누락/비정상 값일 때 커뮤니티 화면만 정상 진입한다.
  • 기존 live/content/series/community_id 딥링크 동작에 회귀가 없다.
  • 푸시 탭/알림 리스트 탭/외부 URL/콜드 스타트에서 결과가 일관된다.

검증 계획

  • 코드 진단
    • lsp_diagnostics 대상: AppDeepLinkHandler.swift, AppState.swift, SplashView.swift, CreatorCommunityAllView.swift, CreatorCommunityAllViewModel.swift
  • 빌드
    • xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build
    • xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build
  • 테스트
    • xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" test
    • xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" test
  • 수동 QA
    • 외부 URL: community/{creatorId}?postId={postId}
    • 푸시 payload deep_link
    • 알림 리스트 아이템 딥링크 탭
    • 콜드 스타트 상태에서 동일 URL 재현

검증 기록

  • 2026-03-13 (계획 수립)

    • 무엇/왜/어떻게: 커뮤니티 댓글 딥링크 구현 범위를 확정하기 위해 내부 라우팅(AppDeepLinkHandler, AppState, SplashView, CreatorCommunityAllView*)과 알림 진입점(AppDelegate, PushNotificationListViewModel)을 병렬 탐색했고, postId 미처리 지점을 기준으로 구현 순서를 체크리스트화했다.
    • 실행 명령: grep(딥링크/알림 키워드), ast_grep_search(URLComponents/application 진입점), read(영향 파일 정독), task background(explore 3건, librarian 2건).
    • 결과: community 딥링크의 postId 처리 부재와 댓글 시트 오픈 가능 지점을 확인했고, 구현/검증 계획을 본 문서에 확정했다.
  • 2026-03-13 (구현/검증 완료)

    • 무엇/왜/어떻게: AppDeepLinkHandlercommunity 액션을 creatorId + postId로 확장하고(postId, post_id 호환), AppStatependingCommunityComment* 상태를 추가해 커뮤니티 진입 직후 CreatorCommunityAllView에서 댓글 시트를 자동 오픈하도록 연결했다. postId가 없거나 비정상인 경우에는 pending 상태를 비우고 기존 커뮤니티 진입만 수행하도록 유지했다.
    • 무엇/왜/어떻게: CreatorCommunityAllViewModelopenCommentListForDeepLink(postId:)를 추가해 대상 게시글이 현재 리스트에 없더라도 postId 기반 댓글 시트가 열리도록 폴백 처리했고, 게시글이 존재하면 기존과 동일한 isShowSecret 계산 로직을 재사용했다.
    • 수정 파일: SodaLive/Sources/App/AppDeepLinkHandler.swift, SodaLive/Sources/App/AppState.swift, SodaLive/Sources/Explorer/Profile/CreatorCommunity/All/CreatorCommunityAllView.swift, SodaLive/Sources/Explorer/Profile/CreatorCommunity/All/CreatorCommunityAllViewModel.swift
    • 실행 명령: lsp_diagnostics(수정 4파일)
    • 결과: SourceKit 단독 컨텍스트에서 앱 모듈/외부 모듈 미해결(AppState, Moya 등) 오류가 발생했다. 아래 Xcode 빌드로 컴파일 성공을 재확인했다.
    • 실행 명령: xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build
    • 결과: ** BUILD SUCCEEDED **
    • 실행 명령: xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build
    • 결과: ** BUILD SUCCEEDED **
    • 실행 명령: xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" test
    • 결과: Scheme SodaLive is not currently configured for the test action.
    • 실행 명령: xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" test
    • 결과: Scheme SodaLive-dev is not currently configured for the test action.
    • 수동 QA: 코드 경로 점검으로 외부 URL/푸시 탭/알림 리스트 탭 모두 AppDeepLinkHandler(.community with postId)AppState.pendingCommunityComment* 저장 → CreatorCommunityAllView.onAppear 소비 → CreatorCommunityCommentListView 시트 오픈 흐름을 확인했다.