Skip to content

Conversation

@geeksbaek
Copy link
Collaborator

Summary

  • NWPathMonitor를 활용한 네트워크 연결 상태 모니터링 기능 구현
  • 실패한 요청을 대기 큐에 저장하고 네트워크 복구 시 자동 재시도
  • 지수 백오프(Exponential Backoff) 알고리즘으로 서버 부하 방지

Changes

NetworkMonitor.swift (신규)

  • NWPathMonitor를 활용한 네트워크 연결 상태 실시간 감지
  • RxSwift Observable로 연결 상태 스트림 제공
  • 실패한 요청 대기 큐 관리 (만료 시간, 최대 재시도 횟수 적용)
  • 연결 복구 시 대기 중인 요청 자동 재실행

DefaultAPIProvider.swift (수정)

  • RetryConfiguration 구조체로 재시도 설정 관리
  • 지수 백오프 + 랜덤 지터(Jitter)로 thundering herd 문제 방지
  • 네트워크 연결 상태에 따른 요청 처리 분기
  • AFErrorAPIError로 매핑하여 재시도 가능 여부 판단

APIError.swift (수정)

  • networkUnavailable: 네트워크 연결 불가 에러
  • retryExhausted: 최대 재시도 횟수 초과 에러
  • isRetryable 속성으로 재시도 가능 여부 판단 (5xx, 408, 429 에러)

Test Plan

  • 비행기 모드에서 앱 실행 시 네트워크 에러 처리 확인
  • 비행기 모드 해제 시 대기 중인 요청 자동 재시도 확인
  • 서버 5xx 에러 발생 시 지수 백오프로 재시도 확인
  • 최대 재시도 횟수 초과 시 retryExhausted 에러 반환 확인

Closes #40

🤖 Generated with Claude Code

NWPathMonitor를 활용한 네트워크 연결 상태 모니터링과 실패한 요청의 자동 재시도 기능을 구현합니다.

주요 변경 사항:
- NetworkMonitor: 네트워크 연결 상태 Observable, 실패 요청 대기 큐 관리
- DefaultAPIProvider: 지수 백오프를 적용한 재시도 로직 통합
- APIError: networkUnavailable, retryExhausted 케이스 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Dec 31, 2025

Warning

Rate limit exceeded

@geeksbaek has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 185dea2 and 6d98dd7.

📒 Files selected for processing (3)
  • Animal-Crossing-Wiki/Projects/App/Sources/Networking/DefaultAPIProvider.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Networking/Utilities/APIError.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Utility/NetworkMonitor.swift

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 and usage tips.

- DefaultAPIProvider 재시도 로직 개선
- NetworkMonitor 상태 관리 개선

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

[공통] 네트워크 연결 상태에 따라 요청을 재시도 하는 기능 추가

3 participants