feat: Crashlytics 추가 및 에러 추적 환경 개선#287
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughCrashlytics를 Core 모듈로 추가하고 CrashlyticsClient 인터페이스 및 Firebase 구현을 정의합니다. 여러 에러 타입을 CustomNSError로 준수시키고, AppCoordinator, Auth, Onboarding, ProofPhoto 기능에서 에러 및 사용자 추적을 Crashlytics로 전송하도록 통합합니다. ChangesCrashlytics 통합 및 에러 기록
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
There was a problem hiding this comment.
고생해쓰 GA PR 코멘트에서 너가 요청한 인증샷 퍼널 이벤트 심어놨는데 컨플릭 해결하면서 함 확인해줘~
그리고 지금 crashlytics.log, crashlytics.record 호출할 때 message를 하드코딩으로 넣는데
Analytics 구현했던것처럼 해서 하드코딩 위험도 낮추고, 화면별로 Crashlytics 로그/에러 볼 수 있게 따로 분리하는건 어때?
참고용 예시(입맛대로 변경 ㄱㄱ)
/// CoreCrashlytics Interface
public protocol CrashlyticsLog {
var message: String { get }
}
public protocol CrashlyticsRecord {
var dict: [String: String] { get }
}
public struct CrashlyticsClient: Sendable {
public var record: @Sendable (Error, any CrashlyticsRecord) -> Void
public var log: @Sendable (any CrashlyticsLog) -> Void
}
/// Feature/ProofPhoto
enum ProofPhotoCrashlyticsLogEvent: CrashlyticsLogEvent {
case uploadStep(UploadStep, goalId: Int64, imageBytes: Int?)
enum UploadStep: String {
case fetchURL
case uploadS3
case createLog
}
var message: String {
switch self {
case let .uploadStep(step, goalId, imageBytes):
if let imageBytes {
return "upload_step: \(step.rawValue), goalId=\(goalId), size=\(imageBytes)"
}
return "upload_step: \(step.rawValue), goalId=\(goalId)"
}
}
}
enum ProofPhotoCrashlyticsRecordEvent: CrashlyticsRecordEvent {
case uploadFailed(
step: UploadStep,
goalId: Int64,
originalImageBytes: Int
)
var customKeys: [String: String] {
switch self {
case let .uploadFailed(step, goalId, originalImageBytes):
return [
CrashlyticsKey.screen: "proof_photo_upload",
CrashlyticsKey.uploadStep: step.rawValue,
CrashlyticsKey.goalId: "\(goalId)",
CrashlyticsKey.originalImageBytes: "\(originalImageBytes)"
]
}
}
}
/// 호출부
crashlytics.log(
ProofPhotoCrashlyticsLogEvent.uploadStep(
.fetchURL,
goalId: goalId,
imageBytes: nil
)
)
crashlytics.record(
error,
ProofPhotoCrashlyticsRecordEvent.uploadFailed(
step: uploadStep,
goalId: goalId,
originalImageBytes: originalSize
)
)| public var caseName: String { | ||
| switch self { | ||
| case .unsupportedProvider: return "unsupportedProvider" | ||
| case .missingCredential: return "missingCredential" | ||
| case .userCanceled: return "userCanceled" | ||
| case .providerError: return "providerError" | ||
| case .serverError: return "serverError" | ||
| case .networkError: return "networkError" | ||
| case .storageFailed: return "storageFailed" | ||
| case .tokenRefreshFailed: return "tokenRefreshFailed" | ||
| } | ||
| } |
There was a problem hiding this comment.
case네이밍이랑 caseName 값 같아서 enum에 String 채택하고 rawValue쓰는건 어때?
e383348 to
b515d0d
Compare
|
@jihun32 반영 완료 |
확인했고 머지할게~ |
* chore: FirebaseCrashlytics SPM 의존성 및 모듈 등록 - #286 * feat: Crashlytics dSYM 업로드 스크립트 추가 - #286 * feat: Core/Crashlytics 모듈 추가 - #286 * feat: Core 에러 타입에 CustomNSError 적용 - #286 * feat: Domain 에러 타입에 CustomNSError 적용 및 AuthClient 에러 wrapping - #286 * chore: App 타겟에 Crashlytics 의존성 및 dSYM 스크립트 추가 - #286 * feat: AppDelegate에 Crashlytics 수집 설정 추가 - #286 * feat: AppCoordinator에 Crashlytics 유저 식별자 및 오류 추적 추가 - #286 * feat: Auth Feature에 Crashlytics 로그인 실패 추적 추가 - #286 * feat: ProofPhoto Feature에 Crashlytics 오류 추적 추가 - #286 * feat: Onboarding Feature에 초대 코드 실패 토스트 및 Crashlytics 추적 추가 - #286 * chore: 버전 1.1.2로 업데이트 - #286 * fix: 컴파일 에러 수정 - #286 * fix: CalendarNow 변수명 SwiftLint identifier_name 위반 수정 - #286 * refactor: CrashlyticsClient를 화면별 이벤트 enum 패턴으로 전환 - #286 * refactor: AuthLoginError.caseName 제거 - #286
🔗 관련 이슈
📙 작업 내역
🎨 스크린샷 또는 시연 영상 (선택)
💬 추가 설명 or 리뷰 포인트 (선택)