Skip to content

feat: 이전 운동 기록 API 연동 - #185

Merged
A6ul1213 merged 2 commits into
devfrom
feature/#184-previous-record-api-integration
Nov 4, 2026
Merged

A6ul1213 merged 2 commits into
devfrom
feature/#184-previous-record-api-integration

Conversation

@A6ul1213

@A6ul1213 A6ul1213 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • 기존 운동 세션에 GET /api/v1/exercises/{exerciseId}/previous-record를 연결했습니다.
  • 유효한 기록 응답은 운동 진행·휴식 화면에 표시하고, 요청 실패나 명세에 맞지 않는 응답은 기존 표시를 보존하며 오류와 재시도를 제공합니다.
  • Notion의 필수 응답 필드를 유지합니다. 백엔드가 현재 반환하는 불완전한 hasPreviousRecord: false 응답은 디코딩 오류로 처리됩니다.

Related issue

Closes #184

Verification

  • Tuist project generation — 첫 PR CI에서 통과; 새 커밋에서 재실행 중
  • Build — 로컬 Xcode가 변경하지 않은 파일의 Preview/State/Observable 매크로 플러그인 오류와 CoreSimulatorService 오류로 완료되지 않음
  • Unit tests — 로컬에서 실행하지 않음; 첫 PR CI는 lint 실패 뒤 테스트를 건너뜀, 새 커밋에서 재실행 중
  • SwiftLint — 로컬 바이너리를 사용할 수 없음; 첫 PR CI에서 나온 5건을 구조 변경으로 수정했고 새 커밋에서 재실행 중
  • Runtime or UI check — 로컬 빌드 실패로 시뮬레이터 실행과 캡처를 확인하지 못함
  • 통과: 변경 Swift 소스 구문 파싱(swiftc -frontend -parse), git diff --check

Review checklist

  • Scope is limited to the linked issue.
  • Tests cover changed behavior where appropriate.
  • No secrets, generated Xcode project files, or unrelated changes are included.

@dltldn1234 dltldn1234 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

변경 범위와 API 호출 경로는 Issue #184의 요구 및 기존 API 서비스와 맞습니다. 다만 현재 CI Generate, lint, and test는 SwiftLint 오류 5건으로 실패했고, XCTest 단계도 실행되지 않았습니다. PR에는 새 동작 테스트가 없으며 Issue #184에서 요구한 성공·기록 없음·실패·재시도 흐름을 확인할 수 없습니다. 아래 코멘트의 lint 위반을 고치고 해당 상태 테스트를 추가한 뒤 CI를 다시 실행해 주세요. 현재는 승인할 수 없습니다.

var sets: [WorkoutSessionSet]
var imageAssetOverride: String?
var usesSampleHistory = true
var previousRecord: WorkoutSessionPreviousRecord? = nil

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] = nil을 제거해 주세요. 이 줄에서 SwiftLint implicit_optional_initialization이 실패해 CI가 막힙니다. Optional 프로퍼티는 초기값을 생략해도 자동으로 nil로 초기화됩니다.

WorkoutSessionRecordSummary(exercise: exercise, currentSetIndex: currentSetIndex)
.padding(.top, 9)
if let previousRecordError {
WorkoutSessionRecordRetryBanner(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] 이 추가로 파일이 411줄이 되어 SwiftLint 400줄 제한을 넘었습니다. 재사용 가능한 오류 배너를 별도 구성으로 추출해 이 파일을 제한 안으로 줄여 주세요.

loadingPreviousRecordExerciseIDs.contains(exerciseID)
}

func loadPreviousRecord(for exerciseID: String) async {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] 이 로딩 흐름이 클래스 본문을 SwiftLint 제한인 250줄보다 3줄 초과시킵니다(253줄). 이전 기록 조회와 상태 처리를 별도 extension/helper로 옮겨 CI를 통과시켜 주세요.

Task { await WorkoutRestActivityController.shared.end(sessionID: liveActivitySessionID) }
}
.task { showFirstExercisePromptIfNeeded() }
.task(id: "\(viewModel.hasStarted)-\(viewModel.currentExercise?.id ?? "")") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] 이 조회 task와 추가된 연결부 때문에 SwiftLint에서 파일 길이(412/400)와 본문 길이(256/250) 두 항목이 실패합니다. 이전 기록 조회/재시도 UI 연결을 별도 하위 뷰나 ViewModifier로 분리해 둘 제한을 모두 해결해 주세요.

weightKilograms = response.weight
repetitions = response.reps
setIndex = response.setIndex
performedAtLabel = Self.dateLabel(from: response.performedAt)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] 날짜·이전 기록 표시와 ViewModel의 성공/기록 없음/실패/재시도 동작을 검증하는 회귀 테스트를 추가해 주세요. Issue #184의 검증 조건인데 현재 PR에는 테스트가 없고, 이번 CI도 SwiftLint 실패 때문에 XCTest를 건너뛰었습니다.

@A6ul1213
A6ul1213 marked this pull request as ready for review November 4, 2026 11:15
@A6ul1213
A6ul1213 merged commit 1e32eb7 into dev Nov 4, 2026
1 check passed
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.

[Feature] 이전 운동 기록 API 연동

2 participants