Skip to content

[#259] 공급자 링크 시 서로 다른 이메일로 연결을 시도할 경우 에러가 아닌 같은 이메일로 해야 한다는 안내문을 보이도록 개선한다#263

Merged
opficdev merged 3 commits intodevelopfrom
fix/#259-link-alert
Mar 12, 2026
Merged

[#259] 공급자 링크 시 서로 다른 이메일로 연결을 시도할 경우 에러가 아닌 같은 이메일로 해야 한다는 안내문을 보이도록 개선한다#263
opficdev merged 3 commits intodevelopfrom
fix/#259-link-alert

Conversation

@opficdev
Copy link
Copy Markdown
Owner

@opficdev opficdev self-assigned this Mar 12, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 외부 인증 공급자 연결 시 발생하는 오류 처리 방식을 개선합니다. 기존의 일반적인 오류 메시지 대신, 사용자가 다른 이메일로 연결을 시도하거나, 이메일을 찾을 수 없거나, 이미 사용 중인 자격 증명으로 연결하려 할 때 더 명확하고 구체적인 안내를 제공하여 사용자 경험을 향상시킵니다. 이는 데이터 계층에서 오류를 매핑하고, 프레젠테이션 계층에서 적절한 알림을 표시함으로써 이루어집니다.

Highlights

  • 새로운 인증 오류 유형 정의: 공급자 연결 과정에서 발생할 수 있는 '이메일 찾을 수 없음', '이메일 불일치', '이미 사용 중인 자격 증명'과 같은 특정 오류를 나타내는 새로운 AuthError 케이스가 추가되었습니다.
  • 데이터 계층 오류 매핑: AuthDataRepositoryImpl에 mapLinkError 함수를 도입하여 하위 계층에서 발생하는 다양한 오류를 새로 정의된 AuthError 유형으로 변환하도록 개선되었습니다.
  • UI 알림 개선: AccountViewModel에 공급자 연결 관련 오류에 대한 새로운 AlertType이 추가되었으며, 각 오류 상황에 맞는 구체적이고 사용자 친화적인 알림 제목과 메시지가 한국어로 제공됩니다.
Changelog
  • DevLog/Data/Common/DataLayerError.swift
    • 공급자 연결 관련 AuthError 케이스(linkEmailNotFound, linkEmailMismatch, linkCredentialAlreadyInUse)가 추가되었습니다.
  • DevLog/Data/Repository/AuthDataRepositoryImpl.swift
    • link 메서드에 오류 처리 로직이 추가되어 mapLinkError 함수를 통해 특정 연결 오류를 매핑하도록 변경되었습니다.
    • 하위 오류를 AuthError 유형으로 변환하는 mapLinkError private 확장 함수가 구현되었습니다.
  • DevLog/Presentation/ViewModel/AccountViewModel.swift
    • 공급자 연결 오류를 위한 새로운 AlertType 케이스(linkEmailNotFound, linkEmailMismatch, linkCredentialAlreadyInUse)가 추가되었습니다.
    • link 액션의 오류 처리 로직이 linkAlertType 함수를 사용하여 특정 오류에 맞는 알림 유형을 반환하도록 업데이트되었습니다.
    • setAlert 함수에 새로운 연결 오류 유형에 대한 한국어 알림 제목과 메시지가 정의되었습니다.
Activity
  • 이 PR에 대한 활동은 제공되지 않았습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 공급자(provider) 계정 연결 시 발생할 수 있는 다양한 오류 상황에 대해 구체적인 에러 케이스를 정의하고, 사용자에게 상황에 맞는 명확한 안내 메시지를 보여주도록 개선했습니다. 데이터 레이어에서 발생하는 에러를 도메인 에러로 매핑하고, 이를 뷰모델에서 적절히 처리하여 UI에 반영하는 흐름이 명확하게 구현되었습니다. 전반적으로 사용자 경험을 향상시키는 좋은 변경이라고 생각합니다. 코드의 가독성과 안정성을 높이기 위한 몇 가지 작은 제안을 드립니다.

Comment on lines +102 to +107
switch authErrorCode {
case .credentialAlreadyInUse:
return AuthError.linkCredentialAlreadyInUse
default:
break
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

switch 구문은 .credentialAlreadyInUse 케이스 하나만 처리하고 있습니다. 단일 케이스를 처리하는 경우에는 if 문을 사용하는 것이 코드를 더 간결하고 읽기 쉽게 만듭니다.

            if authErrorCode == .credentialAlreadyInUse {
                return AuthError.linkCredentialAlreadyInUse
            }

Comment on lines +144 to +159
func linkAlertType(for error: Error) -> AlertType {
if let authError = error as? AuthError {
switch authError {
case .linkEmailNotFound:
return .linkEmailNotFound
case .linkEmailMismatch:
return .linkEmailMismatch
case .linkCredentialAlreadyInUse:
return .linkCredentialAlreadyInUse
default:
break
}
}

return .error
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

현재 switch 문은 명시적으로 처리되지 않은 케이스에 대해 default: break를 사용하여 함수 마지막의 return .error로 처리 흐름을 넘기고 있습니다. AuthError의 모든 케이스를 switch 문 안에서 명시적으로 처리하도록 변경하면, 향후 AuthError에 새로운 케이스가 추가되었을 때 컴파일러가 이를 감지하여 실수를 방지할 수 있습니다. 이는 코드의 안정성을 높이는 데 도움이 됩니다.

Suggested change
func linkAlertType(for error: Error) -> AlertType {
if let authError = error as? AuthError {
switch authError {
case .linkEmailNotFound:
return .linkEmailNotFound
case .linkEmailMismatch:
return .linkEmailMismatch
case .linkCredentialAlreadyInUse:
return .linkCredentialAlreadyInUse
default:
break
}
}
return .error
}
func linkAlertType(for error: Error) -> AlertType {
guard let authError = error as? AuthError else {
return .error
}
switch authError {
case .linkEmailNotFound:
return .linkEmailNotFound
case .linkEmailMismatch:
return .linkEmailMismatch
case .linkCredentialAlreadyInUse:
return .linkCredentialAlreadyInUse
case .notAuthenticated, .failedToUnlinkLastProvider, .unsupportedProvider:
return .error
}
}

@opficdev opficdev merged commit a4c1017 into develop Mar 12, 2026
2 checks passed
@opficdev opficdev deleted the fix/#259-link-alert branch March 12, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant