Skip to content

[Refactor] 닉네임 관련 기능 User로 병합#83

Merged
UiHyeon-Kim merged 6 commits intodevelopfrom
feature/nickname_refactor
Mar 16, 2026
Merged

[Refactor] 닉네임 관련 기능 User로 병합#83
UiHyeon-Kim merged 6 commits intodevelopfrom
feature/nickname_refactor

Conversation

@UiHyeon-Kim
Copy link
Member

@UiHyeon-Kim UiHyeon-Kim commented Mar 9, 2026

✨ 주요 변경 사항

  • 동일한 엔드포인트끼리 일관성 및 응집도 목적 수정

✅ 체크리스트

  • 🌱 merge 브랜치 확인
  • 🛠️ 빌드 성공
  • 💬 관련 이슈 연결 ([Closes | Fixes | Resolves] #123)

🔍 중점 리뷰 사항

비고

  • verdict_base 브랜치의 내용이 너무 커 분리하여 올림

📸 스크린샷

e.g. <img width="45%" src="링크" />

JuhyeokLee97 and others added 4 commits March 10, 2026 00:15
- NicknameRepository 및 NicknameRepositoryImpl 삭제
- UserRepository 인터페이스에 nickname 관련 메서드(save, get, observe) 추가
- UserRepositoryImpl에서 UserApi 및 ProfileDataStore를 사용하여 nickname 기능 구현
- RepositoryModule에서 NicknameRepository 바인딩 제거 및 AuthRepository에 @singleton 추가
- RemoteUser: id, nickname, level, invitationCode를 포함하는 신규 모델 추가
- UserApi: getProfile의 반환 타입을 ProfileResponse에서 RemoteUser로 변경
- Repository: NicknameRepository를 UserRepository로 변경하여 닉네임 관련 유스케이스에서 사용
- Model: 더 이상 사용되지 않는 User 도메인 모델 삭제
- `com.smtm.pickle.domain.usecase.nickname` 패키지를 `com.smtm.pickle.domain.usecase.user`로 이동
- `GetNicknameUseCase`, `SaveNicknameUseCase`, `ObserveNicknameUseCase` 경로 수정 및 관련 import문 업데이트
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • 기능 개선
    • 닉네임 관리 기능을 사용자 프로필 관리로 통합하여 더 나은 사용자 경험 제공
    • 닉네임이 없을 때 기본 닉네임 "유저 닉네임" 자동 표시
    • 사용자 프로필 동기화 및 실시간 닉네임 업데이트 기능 개선

Walkthrough

닉네임 책임을 별도 NicknameRepository에서 UserRepository로 통합하고, 관련 UseCase/구현/DI/원격 모델을 재배치 및 정리한 리팩토링입니다. 일부 원격/도메인 모델과 DI 바인딩이 변경 또는 제거되었습니다. (≤50단어)

Changes

Cohort / File(s) Summary
도메인 리포지토리 변경
domain/src/main/java/com/smtm/pickle/domain/repository/NicknameRepository.kt, domain/src/main/java/com/smtm/pickle/domain/repository/UserRepository.kt
NicknameRepository 인터페이스 제거. UserRepositorysaveNickname, getNickname(): String?, observeNickname(): Flow<String?> 메서드 추가.
도메인 유스케이스 재배치/변경
domain/src/main/java/com/smtm/pickle/domain/usecase/user/SaveNicknameUseCase.kt, .../GetNicknameUseCase.kt, .../ObserveNicknameUseCase.kt, (삭제된) domain/.../usecase/nickname/ObserveNicknameUseCase.kt
nickname 패키지에서 user 패키지로 이동/재작성. SaveNicknameUseCase 의존성 변경(NicknameRepository → UserRepository). 신규 GetNicknameUseCase, ObserveNicknameUseCase 추가; 기존 ObserveNicknameUseCase 삭제.
데이터 레이어 리포지토리 구현 변경
data/src/main/java/com/smtm/pickle/data/repository/UserRepositoryImpl.kt, data/src/main/java/com/smtm/pickle/data/repository/NicknameRepositoryImpl.kt
NicknameRepositoryImpl 파일 삭제. UserRepositoryImplUserApi, ProfileDataStore 의존성 추가, 닉네임 관련 메서드(저장/조회/옵저브) 통합 및 클래스에 @Singleton 추가.
데이터 레이어 DI 및 Auth 구현
data/src/main/java/com/smtm/pickle/data/di/RepositoryModule.kt, data/src/main/java/com/smtm/pickle/data/repository/AuthRepositoryImpl.kt
RepositoryModule에서 닉네임 바인딩 제거. bindAuthRepository 시그니처 파라미터명 변경 및 @Singleton 추가. AuthRepositoryImpl 클래스에서 @Singleton 애너테이션 제거(구현 클래스 애너테이션 삭제).
원격 모델 및 API 변경
data/src/main/java/com/smtm/pickle/data/source/remote/api/UserApi.kt, data/src/main/java/com/smtm/pickle/data/source/remote/model/user/RemoteUser.kt, .../ProfileResponse.kt
UserApi.getProfile() 반환형을 ProfileResponseRemoteUser로 변경. 신규 RemoteUser 데이터 클래스 추가. 기존 ProfileResponse 클래스 삭제.
도메인 모델 정리
domain/src/main/java/com/smtm/pickle/domain/model/auth/User.kt
도메인의 User 데이터 클래스 삭제.
프레젠테이션 레이어 경로 업데이트
presentation/src/.../HomeViewModel.kt, .../NicknameViewModel.kt, .../MyPageViewModel.kt, .../ProfileViewModel.kt, .../nicknamesetting/NicknameSettingViewModel.kt
UseCase 임포트 경로를 domain.usecase.user로 변경. 초기값/포맷 소폭 조정(무해한 변경).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

리뷰 중

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 핵심을 명확하게 반영합니다. 닉네임 관련 기능을 User로 병합하는 리팩터링이라는 주요 변경 사항이 잘 요약되어 있습니다.
Description check ✅ Passed PR 설명이 템플릿의 필수 섹션을 포함하고 있습니다. 주요 변경 사항, 체크리스트, 중점 리뷰 사항이 작성되었으며, 비고 섹션으로 추가 맥락도 제공됩니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/nickname_refactor
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

@gemini-code-assist
Copy link

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!

이 Pull Request는 닉네임 관리 기능을 User 도메인으로 통합하여 코드의 일관성과 응집도를 높이는 리팩토링을 수행합니다. 기존에 분리되어 있던 닉네임 관련 저장소 및 UseCase를 제거하고, 해당 기능을 사용자 저장소로 병합함으로써 중복을 줄이고 유지보수성을 향상시켰습니다. 이 변경은 애플리케이션의 데이터 및 도메인 계층 구조를 간소화하는 데 기여합니다.

Highlights

  • 닉네임 기능 통합: 닉네임 관련 기능이 User 도메인으로 통합되어, 기존의 NicknameRepository 인터페이스와 구현체가 제거되었습니다.
  • UserRepository 확장: 닉네임 저장, 조회, 관찰 로직이 UserRepositoryUserRepositoryImpl로 이동되어 사용자 관련 기능의 응집도가 향상되었습니다.
  • UseCase 재구성: 닉네임 관련 UseCase들이 user 패키지로 재배치되고 UserRepository를 사용하도록 변경되어 도메인 계층의 일관성이 강화되었습니다.
  • 데이터 모델 변경: 원격 사용자 프로필 응답을 위한 RemoteUser 데이터 클래스가 새로 추가되었으며, UserApigetProfile 메서드 반환 타입이 업데이트되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • data/src/main/java/com/smtm/pickle/data/di/RepositoryModule.kt
    • NicknameRepository 관련 바인딩이 제거되었습니다.
    • AuthRepository@Singleton 어노테이션이 추가되었습니다.
  • data/src/main/java/com/smtm/pickle/data/repository/NicknameRepositoryImpl.kt
    • 닉네임 저장소 구현체가 제거되었습니다.
  • data/src/main/java/com/smtm/pickle/data/repository/UserRepositoryImpl.kt
    • 닉네임 저장, 조회, 관찰 로직이 추가되었습니다.
    • UserApiProfileDataStore 의존성이 주입되었습니다.
    • 클래스에 @Singleton 어노테이션이 추가되었습니다.
  • data/src/main/java/com/smtm/pickle/data/source/remote/api/UserApi.kt
    • getProfile 메서드의 반환 타입이 ProfileResponse에서 RemoteUser로 변경되었습니다.
  • data/src/main/java/com/smtm/pickle/data/source/remote/model/user/RemoteUser.kt
    • 원격 사용자 정보를 위한 RemoteUser 데이터 클래스가 새로 추가되었습니다.
  • domain/src/main/java/com/smtm/pickle/domain/model/auth/User.kt
    • User 도메인 모델이 제거되었습니다.
  • domain/src/main/java/com/smtm/pickle/domain/repository/NicknameRepository.kt
    • 닉네임 저장소 인터페이스가 제거되었습니다.
  • domain/src/main/java/com/smtm/pickle/domain/repository/UserRepository.kt
    • 닉네임 관련 추상 메서드들이 UserRepository 인터페이스에 추가되었습니다.
  • domain/src/main/java/com/smtm/pickle/domain/usecase/nickname/GetNicknameUseCase.kt
    • 닉네임 조회 UseCase가 user 패키지로 이동하고 UserRepository를 사용하도록 업데이트되었습니다.
  • domain/src/main/java/com/smtm/pickle/domain/usecase/nickname/ObserveNicknameUseCase.kt
    • 닉네임 관찰 UseCase가 제거되었습니다.
  • domain/src/main/java/com/smtm/pickle/domain/usecase/nickname/SaveNicknameUseCase.kt
    • 닉네임 저장 UseCase가 user 패키지로 이동하고 UserRepository를 사용하도록 업데이트되었습니다.
  • domain/src/main/java/com/smtm/pickle/domain/usecase/user/ObserveNicknameUseCase.kt
    • UserRepository를 사용하는 새로운 닉네임 관찰 UseCase가 추가되었습니다.
  • presentation/src/main/java/com/smtm/pickle/presentation/home/HomeViewModel.kt
    • ObserveNicknameUseCase의 import 경로가 업데이트되었습니다.
    • 코드 포맷이 수정되었습니다.
  • presentation/src/main/java/com/smtm/pickle/presentation/login/nickname/NicknameViewModel.kt
    • SaveNicknameUseCase의 import 경로가 업데이트되었습니다.
  • presentation/src/main/java/com/smtm/pickle/presentation/mypage/MyPageViewModel.kt
    • ObserveNicknameUseCase의 import 경로가 업데이트되었습니다.
    • _effect 채널 초기화 방식이 수정되었습니다.
  • presentation/src/main/java/com/smtm/pickle/presentation/mypage/profile/ProfileViewModel.kt
    • ObserveNicknameUseCase의 import 경로가 업데이트되었습니다.
  • presentation/src/main/java/com/smtm/pickle/presentation/mypage/profile/nicknamesetting/NicknameSettingViewModel.kt
    • 닉네임 관련 UseCase들의 import 경로가 업데이트되었습니다.
Activity
  • 현재까지 풀 리퀘스트에 대한 추가적인 활동은 없습니다.
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

@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

닉네임 관련 기능을 User 도메인으로 통합하는 리팩토링이 잘 이루어졌습니다. 이로 인해 코드의 응집도가 높아지고 구조가 더 명확해졌습니다. 한 가지 코드 가독성을 높일 수 있는 작은 제안을 드립니다.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
domain/src/main/java/com/smtm/pickle/domain/repository/UserRepository.kt (1)

17-19: 닉네임 조회 계약의 nullability를 한쪽으로 맞춰두면 호출부가 더 단순해질 것 같습니다.

지금은 getNickname()은 non-null인데 observeNickname()은 nullable이라서, 이미 ProfileViewModel(Line 26-32)과 MyPageViewModel(Line 45-49)에서 기본값 보정이 중복되고 있습니다. 닉네임 미존재가 정상 상태라면 둘 다 nullable로, 아니라면 repository/usecase 레이어에서 non-null을 보장하는 방향으로 맞춰보시면 이후 호출부가 훨씬 깔끔해질 것 같습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@domain/src/main/java/com/smtm/pickle/domain/repository/UserRepository.kt`
around lines 17 - 19, Change the nickname contract so both methods share the
same nullability to avoid repeated defaulting: update
UserRepository.observeNickname() to return Flow<String> (matching suspend fun
getNickname(): String) by mapping the underlying Flow<String?> to a non-null
String with a clear default/fallback at the repository layer; adjust the
concrete repository implementation to perform the null-to-default mapping and
then remove the redundant defaulting in ProfileViewModel and MyPageViewModel
where observeNickname() is consumed. Ensure the method signature for
observeNickname and its implementation are updated together so callers no longer
need to handle nullable nicknames.
data/src/main/java/com/smtm/pickle/data/repository/UserRepositoryImpl.kt (1)

13-18: 구현체의 @Singleton 제거 권장

UserRepositoryImplAuthRepositoryImpl은 클래스 수준과 RepositoryModule@Binds 메서드 양쪽에 @Singleton을 선언하고 있습니다. 반면 LedgerRepositoryImpl은 모듈의 @Binds 메서드에만 @Singleton을 선언하고 있어, 세 구현체 간 패턴이 일관성 없습니다.

Hilt에서는 일반적으로 모듈의 바인딩 메서드에만 스코프를 지정하는 것이 권장됩니다. LedgerRepositoryImpl의 패턴에 맞춰 UserRepositoryImplAuthRepositoryImpl에서 클래스 수준의 @Singleton 어노테이션과 임포트를 제거하면, 더 명확한 의존성 관리와 일관된 코드 스타일을 유지할 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@data/src/main/java/com/smtm/pickle/data/repository/UserRepositoryImpl.kt`
around lines 13 - 18, Remove the class-level `@Singleton` annotation and its
import from UserRepositoryImpl and AuthRepositoryImpl so scoping is only
declared on the `@Binds` methods in RepositoryModule (matching
LedgerRepositoryImpl’s pattern); locate the annotations on the classes named
UserRepositoryImpl and AuthRepositoryImpl and delete the `@Singleton` usage and
any unused import, leaving the module-level `@Singleton` on the corresponding bind
methods as the sole scope declaration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@data/src/main/java/com/smtm/pickle/data/repository/UserRepositoryImpl.kt`:
- Around line 13-18: Remove the class-level `@Singleton` annotation and its import
from UserRepositoryImpl and AuthRepositoryImpl so scoping is only declared on
the `@Binds` methods in RepositoryModule (matching LedgerRepositoryImpl’s
pattern); locate the annotations on the classes named UserRepositoryImpl and
AuthRepositoryImpl and delete the `@Singleton` usage and any unused import,
leaving the module-level `@Singleton` on the corresponding bind methods as the
sole scope declaration.

In `@domain/src/main/java/com/smtm/pickle/domain/repository/UserRepository.kt`:
- Around line 17-19: Change the nickname contract so both methods share the same
nullability to avoid repeated defaulting: update
UserRepository.observeNickname() to return Flow<String> (matching suspend fun
getNickname(): String) by mapping the underlying Flow<String?> to a non-null
String with a clear default/fallback at the repository layer; adjust the
concrete repository implementation to perform the null-to-default mapping and
then remove the redundant defaulting in ProfileViewModel and MyPageViewModel
where observeNickname() is consumed. Ensure the method signature for
observeNickname and its implementation are updated together so callers no longer
need to handle nullable nicknames.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 408d218e-0db8-4b49-9716-5fcded8dc72e

📥 Commits

Reviewing files that changed from the base of the PR and between 670dbe3 and 34a8f41.

📒 Files selected for processing (17)
  • data/src/main/java/com/smtm/pickle/data/di/RepositoryModule.kt
  • data/src/main/java/com/smtm/pickle/data/repository/NicknameRepositoryImpl.kt
  • data/src/main/java/com/smtm/pickle/data/repository/UserRepositoryImpl.kt
  • data/src/main/java/com/smtm/pickle/data/source/remote/api/UserApi.kt
  • data/src/main/java/com/smtm/pickle/data/source/remote/model/user/RemoteUser.kt
  • domain/src/main/java/com/smtm/pickle/domain/model/auth/User.kt
  • domain/src/main/java/com/smtm/pickle/domain/repository/NicknameRepository.kt
  • domain/src/main/java/com/smtm/pickle/domain/repository/UserRepository.kt
  • domain/src/main/java/com/smtm/pickle/domain/usecase/nickname/ObserveNicknameUseCase.kt
  • domain/src/main/java/com/smtm/pickle/domain/usecase/user/GetNicknameUseCase.kt
  • domain/src/main/java/com/smtm/pickle/domain/usecase/user/ObserveNicknameUseCase.kt
  • domain/src/main/java/com/smtm/pickle/domain/usecase/user/SaveNicknameUseCase.kt
  • presentation/src/main/java/com/smtm/pickle/presentation/home/HomeViewModel.kt
  • presentation/src/main/java/com/smtm/pickle/presentation/login/nickname/NicknameViewModel.kt
  • presentation/src/main/java/com/smtm/pickle/presentation/mypage/MyPageViewModel.kt
  • presentation/src/main/java/com/smtm/pickle/presentation/mypage/profile/ProfileViewModel.kt
  • presentation/src/main/java/com/smtm/pickle/presentation/mypage/profile/nicknamesetting/NicknameSettingViewModel.kt
💤 Files with no reviewable changes (4)
  • domain/src/main/java/com/smtm/pickle/domain/model/auth/User.kt
  • domain/src/main/java/com/smtm/pickle/domain/repository/NicknameRepository.kt
  • data/src/main/java/com/smtm/pickle/data/repository/NicknameRepositoryImpl.kt
  • domain/src/main/java/com/smtm/pickle/domain/usecase/nickname/ObserveNicknameUseCase.kt

- domain: `UserRepository` 및 `GetNicknameUseCase`의 반환 타입을 `String?`로 변경하여 널 허용
- presentation: `NicknameSettingViewModel`에서 닉네임이 없을 경우 기본값("유저 닉네임") 제공
- data: `AuthRepositoryImpl`, `UserRepositoryImpl` 클래스 레벨의 `@Singleton` 어노테이션 제거 및 `RepositoryModule` 파라미터명 정리
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@presentation/src/main/java/com/smtm/pickle/presentation/mypage/profile/nicknamesetting/NicknameSettingViewModel.kt`:
- Around line 45-47: 현재 _uiState.update { it.copy(editingNickname = nickname ?:
"유저 닉네임") } 로 기본 표시문구를 상태값에 넣어 저장 시 실제로 "유저 닉네임"이 서버로 전송될 가능성이 있습니다;
editingNickname은 빈 문자열 또는 실제 닉네임으로 유지하고 표시용 힌트(placeholder)는 View 쪽에서 처리하도록
변경하세요: 즉, _uiState 업데이트 시 editingNickname = nickname ?: ""(또는 기존 닉네임)으로 바꾸고, 저장
로직(예: saveNickname 또는 해당 저장 경로)이 editingNickname 값을 그대로 전송하지 않도록 빈 문자열 체크를 추가해
실제 사용자 입력이 없으면 서버에 기본 문구를 보내지 않도록 하세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1fb6f858-b8b1-4691-8758-fad416b2af19

📥 Commits

Reviewing files that changed from the base of the PR and between 34a8f41 and 6133485.

📒 Files selected for processing (7)
  • data/src/main/java/com/smtm/pickle/data/di/RepositoryModule.kt
  • data/src/main/java/com/smtm/pickle/data/repository/AuthRepositoryImpl.kt
  • data/src/main/java/com/smtm/pickle/data/repository/UserRepositoryImpl.kt
  • data/src/main/java/com/smtm/pickle/data/source/remote/model/user/ProfileResponse.kt
  • domain/src/main/java/com/smtm/pickle/domain/repository/UserRepository.kt
  • domain/src/main/java/com/smtm/pickle/domain/usecase/user/GetNicknameUseCase.kt
  • presentation/src/main/java/com/smtm/pickle/presentation/mypage/profile/nicknamesetting/NicknameSettingViewModel.kt
💤 Files with no reviewable changes (2)
  • data/src/main/java/com/smtm/pickle/data/source/remote/model/user/ProfileResponse.kt
  • data/src/main/java/com/smtm/pickle/data/repository/AuthRepositoryImpl.kt

Comment on lines 45 to 47
_uiState.update {
it.copy(editingNickname = nickname)
it.copy(editingNickname = nickname ?: "유저 닉네임")
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

표시용 기본 문구가 실제 저장 닉네임으로 전송될 수 있어 보입니다.

Line 46에서 editingNickname"유저 닉네임"을 넣으면, 사용자가 수정 없이 저장할 때 Line 68 경로로 해당 문자열이 서버에 저장될 수 있습니다. 표시용 기본 문구는 UI 힌트로 분리하고, 상태값은 빈 문자열(또는 실제 닉네임)로 유지하는 쪽을 제안드립니다.

제안 수정안
-                    _uiState.update {
-                        it.copy(editingNickname = nickname ?: "유저 닉네임")
-                    }
+                    _uiState.update {
+                        it.copy(editingNickname = nickname.orEmpty())
+                    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
_uiState.update {
it.copy(editingNickname = nickname)
it.copy(editingNickname = nickname ?: "유저 닉네임")
}
_uiState.update {
it.copy(editingNickname = nickname.orEmpty())
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@presentation/src/main/java/com/smtm/pickle/presentation/mypage/profile/nicknamesetting/NicknameSettingViewModel.kt`
around lines 45 - 47, 현재 _uiState.update { it.copy(editingNickname = nickname ?:
"유저 닉네임") } 로 기본 표시문구를 상태값에 넣어 저장 시 실제로 "유저 닉네임"이 서버로 전송될 가능성이 있습니다;
editingNickname은 빈 문자열 또는 실제 닉네임으로 유지하고 표시용 힌트(placeholder)는 View 쪽에서 처리하도록
변경하세요: 즉, _uiState 업데이트 시 editingNickname = nickname ?: ""(또는 기존 닉네임)으로 바꾸고, 저장
로직(예: saveNickname 또는 해당 저장 경로)이 editingNickname 값을 그대로 전송하지 않도록 빈 문자열 체크를 추가해
실제 사용자 입력이 없으면 서버에 기본 문구를 보내지 않도록 하세요.

@JuhyeokLee97 JuhyeokLee97 added the 병합 대기 병합이 가능한 상태 label Mar 15, 2026
@UiHyeon-Kim UiHyeon-Kim merged commit 72d1eb2 into develop Mar 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

병합 대기 병합이 가능한 상태

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants