Skip to content

[Feat] 토큰 재발급 흐름 구현 - #89

Merged
MinHeokChoi merged 1 commit into
mainfrom
feat/#88-auth-token-reissue
Jul 28, 2026
Merged

[Feat] 토큰 재발급 흐름 구현#89
MinHeokChoi merged 1 commit into
mainfrom
feat/#88-auth-token-reissue

Conversation

@MinHeokChoi

@MinHeokChoi MinHeokChoi commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

✨ PR 유형

어떤 변경 사항이 있나요??

  • 새로운 기능 추가
  • 버그 수정
  • 사용자 UI 디자인 변경 및 추가
  • 코드에 영향을 주지 않는 변경사항
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

🛠️ 작업내용

  • TokenRefreshCoordinator actor와 AccessTokenRefreshing 경계를 추가했습니다.
  • 동일 access token에서 발생한 동시 bearer 401은 하나의 refresh flight를 공유합니다.
  • public 요청, refresh 요청 자체, 이미 재시도한 요청은 refresh 대상에서 제외합니다.
  • refresh 성공 후 원 요청을 최대 한 번만 재시도합니다.
  • 새 credential은 저장 성공 후 메모리 snapshot과 계정 상태에 반영합니다.
  • stale 401이 새 로그인 세션을 덮어쓰거나 sign out하지 않도록 token 일치 조건을
    적용했습니다.
  • refresh 실패 시 Account Session만 조건부 signedOut 처리하며 Local Session과
    SwiftData에는 손대지 않습니다.
  • mutation 5xx에 일반 HTTP 자동 재시도를 추가하지 않았음을 테스트로 고정했습니다.

검증

  • P3 XCTest: 10 passed
  • P0–P3 관련 XCTest: 60 passed
  • 전체 XCTest: 332 passed, 0 failed/skipped
  • iPhone 16 Simulator Debug build: passed
  • generic iPhone Debug/Release build: passed
  • bash Scripts/check-iphone-functional-gate.sh: passed
  • bash Scripts/check-swiftdata-boundary.sh: passed
  • plutil -lint Moru/Info.plist: passed
  • git diff --check: passed
  • Domain/Data Local/SwiftData/schema 변경: 없음
  • 실제 iPhone: 미검증

📋 추후 진행 상황

  • 후속 P4에서 선택형 Sign in with Apple 계정 연결 UI를 구현합니다.
  • 로그아웃과 회원 탈퇴는 P5에서 구현합니다.

📌 리뷰 포인트

  • 동일 token의 동시 401만 single-flight를 공유하는지 확인해 주세요.
  • stale token과 계정 전환 race가 새 계정 credential을 변경하지 않는지 확인해 주세요.
  • 원 요청 재시도가 1회로 제한되고 mutation 5xx 자동 재시도가 없는지 확인해 주세요.
  • P2 branch만 base로 포함되고 v1 로컬 흐름에 영향이 없는지 확인해 주세요.

✅ Checklist

  • 커밋 메시지 컨벤션에 맞게 작성했습니다
  • token/header/body가 로그에 노출되지 않습니다

Closes #88

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@MinHeokChoi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d42cdd54-41c1-4d52-8e62-6fdc5cac144e

📥 Commits

Reviewing files that changed from the base of the PR and between 24952af and 908eb24.

📒 Files selected for processing (5)
  • Moru/Moru/App/AccountSessionStore.swift
  • Moru/Moru/Data/Remote/Auth/TokenRefreshCoordinator.swift
  • Moru/Moru/Network/Core/APIClient.swift
  • Moru/Moru/Network/Core/AccessTokenRefreshing.swift
  • Moru/MoruTests/AuthTokenReissueTests.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#88-auth-token-reissue

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MinHeokChoi
MinHeokChoi force-pushed the feat/#86-account-session-foundation branch from 6d72465 to 296ad71 Compare July 28, 2026 03:06
Constraint: 동일 token의 refresh는 single-flight로 제한하고 원 요청은 한 번만 재시도
Rejected: 일반 5xx 자동 재시도와 stale 401의 무조건 sign-out | 중복 mutation과 계정 전환 race를 방지하기 위해 제외
Confidence: high
Scope-risk: moderate
Directive: credential 교체와 sign-out은 요청 시점 token 일치 조건을 계속 지킬 것
Tested: 기존 PR HEAD와 tree 동일; PR 기록상 전체 XCTest 332개 및 Foundation·SwiftData gate 성공
Not-tested: 실제 iPhone 토큰 재발급 E2E
@MinHeokChoi
MinHeokChoi force-pushed the feat/#88-auth-token-reissue branch from 6b918bc to 908eb24 Compare July 28, 2026 03:08
@MinHeokChoi
MinHeokChoi changed the base branch from feat/#86-account-session-foundation to main July 28, 2026 03:08
@MinHeokChoi
MinHeokChoi marked this pull request as ready for review July 28, 2026 03:08
@MinHeokChoi
MinHeokChoi merged commit adfe282 into main Jul 28, 2026
6 checks 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.

[Feat] 토큰 재발급과 인증 요청 복구

1 participant