Skip to content

Conversation

@Guryss
Copy link
Member

@Guryss Guryss commented Jan 3, 2025

⭐️Issue


🌟Motivation

  • 탈퇴한 유저의 프로필을 클릭했을 때 토스트가 뜨도록 구현했습니다.

🌟Key Changes

  • 작품상세 피드, 전체 피드, 피드 상세 및 피드 상세 댓글에 적용 완료했습니다.

🌟Simulation

전체 피드 피드 상세 작품 상세 피드
전체피드 피드상세 작품상세피드

🌟To Reviewer

  • 하나 물어볼 것이 있습니다.
    전체 피드에서 탈퇴한 유저일 때 닉네임이 알 수 없음 으로 나오는데, 이 탈퇴 로직에 대한 분기처리를 따로 안해준 것 같거든요.
    서버에서 내려준 탈퇴 유저의 이름이 알 수 없음 인 것 같은데, 피그마 디자인 상으론 (알 수 없음) 으로 괄호가 추가되어야 할 것 같아요!
    이 로직 따로 추가해주실 수 있나요?!
    +) 이 로직과 연결된 MyFeedResult에는 userId를 따로 받는 게 없어서요... 확인 부탁드립니다!

🌟Reference



viewController.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(viewController, animated: false)
self.navigationController?.pushViewController(viewController, animated: true)
Copy link
Member Author

Choose a reason for hiding this comment

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

마이페이지로 넘어가는 함수에 push animation false로 되어있어서 true로 수정해두었습니다.
혹시 false로 한 이유가 있다면 말해주세요 !!

Copy link
Member

Choose a reason for hiding this comment

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

이유 없음!

Comment on lines +38 to +42
private func setUI() {
dropdownImageView.do {
$0.image = .icThreedots.withRenderingMode(.alwaysOriginal).withTintColor(.wssBlack)
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

피그마상 디자인과 드롭다운 버튼 UI가 달라서 수정해두었습니다.

수정 전 수정 후

@Guryss Guryss requested review from ena-isme and hyowon612 and removed request for ena-isme and hyowon612 January 3, 2025 18:00
@Guryss Guryss self-assigned this Jan 3, 2025
@Guryss Guryss modified the milestone: 1차 스프린트 🔔 Jan 5, 2025
@ena-isme
Copy link
Member

ena-isme commented Jan 5, 2025

원래 Feed, MyPage 로직에 unknownUserNotification 을 처리해두었었어요.
기존에는 Feed 에서 선택 => MyPage 로 들어가서 로직처리 => dismiss 후 Feed 뷰로 돌아오기

기존에는 Alert 으로도 뜨고, 토스트뷰도 떠야한다고 했었어서 둘 다 처리해 두었다가 토스트뷰만 남겨두었던 거였습니다! 서연씨가 현재 방법으로 수정해주었으니 해당 브런치에서 제 코드는 지워도 괜찮을까요?

@ena-isme
Copy link
Member

ena-isme commented Jan 5, 2025

그리고 로직 추가가 안되어있는 것 맞아요! 제가 이 부분에 대해 정확하게 처리를 못해두었네요, 위에서 말한대로 해당 브런치 함께 작업해도 괜찮을까요 ?

@Guryss
Copy link
Member Author

Guryss commented Jan 5, 2025

원래 Feed, MyPage 로직에 unknownUserNotification 을 처리해두었었어요. 기존에는 Feed 에서 선택 => MyPage 로 들어가서 로직처리 => dismiss 후 Feed 뷰로 돌아오기

기존에는 Alert 으로도 뜨고, 토스트뷰도 떠야한다고 했었어서 둘 다 처리해 두었다가 토스트뷰만 남겨두었던 거였습니다! 서연씨가 현재 방법으로 수정해주었으니 해당 브런치에서 제 코드는 지워도 괜찮을까요?

넴 그래주신다면야 감사하지요

@Guryss
Copy link
Member Author

Guryss commented Jan 5, 2025

그리고 로직 추가가 안되어있는 것 맞아요! 제가 이 부분에 대해 정확하게 처리를 못해두었네요, 위에서 말한대로 해당 브런치 함께 작업해도 괜찮을까요 ?

넵! 당근

@ena-isme
Copy link
Member

ena-isme commented Jan 5, 2025

@Guryss

Feed FeedDetail
IMG_6173 스크린샷, 2025-01-06 오전 12 34 18
  1. MyPage 쪽 탈퇴유저 Alert 로직 삭제
  2. 삭제된 Feed 네이밍 UnknownUser => UnknownFeed 로 변경
  3. (알 수 없음) 닉네임 로직 처리

해두었으니 확인 부탁드립니다 :)

++ 그리고 MyFeed 상에서는 userID 를 받을 필요가 없고 서버에서도 내려주지 않습니다. 내가 작성한 피드만 보이기 때문에 알수없음 처리를 할 필요가 없어 UserDefault 에 저장된 userID 로 사용하고 있습니다 :)

Copy link
Member Author

@Guryss Guryss left a comment

Choose a reason for hiding this comment

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

하나 확인 부탁드립니당 ( _ _ )
생각보다 수정할 게 많았네여...... 😇 아리가또네 ☺️😍

Comment on lines +134 to +138
if data.nickname == "" {
userNicknameLabel.applyWSSFont(.headline1, with: StringLiterals.Error.unknownUser)
} else {
userNicknameLabel.applyWSSFont(.headline1, with: data.nickname)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

요 분기처리는 안들어가두 되지 않을까용?

어짜피 뷰가 넘어가기전에 탈퇴유저인지 확인을 하는거라서 탈퇴유저라면 마이페이지가 안보이잖아요!!

Copy link
Member

@ena-isme ena-isme Jan 5, 2025

Choose a reason for hiding this comment

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

MyPageViewModel 상에 표기해두었습니둥 @Guryss
서버가 혹시라도 에러가 나서 "USER-018" 에러를 내려주었을 때? 를 대비합니다
(사실 에러는 있는데 에러처리가 없는게 이상해서 해두었어요ㅎㅎ)

//현재 로직상 알 수 없는 유저 프로필을 확인하는 것은 불가능하지만
//서버에러에 대응하여 아래처럼 처리
                     if self.isUnknownUserError(error) {
                         let data = MyProfileResult(
                             nickname: "",
                             intro: "",
                             avatarImage: "",
                             genrePreferences: []
                         )
                         self.profileDataRelay.accept(data)
                         self.isProfilePrivateRelay.accept((false, ""))
                     }
                     return .empty()
                 }

Copy link
Member Author

Choose a reason for hiding this comment

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

우왕 알겠듭니다 !!!! 몰랐어요 ㅎㅁㅎ

Copy link
Member

@ena-isme ena-isme left a comment

Choose a reason for hiding this comment

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

1.0.3 업뎃은 only 구리스 ,,, 🔥🔥

@Naknakk Naknakk requested review from Naknakk and removed request for hyowon612 January 9, 2025 06:34
@Naknakk Naknakk requested review from ChaeAg and hyowon612 and removed request for ChaeAg, Naknakk and hyowon612 January 9, 2025 06:34
Copy link
Contributor

@Naknakk Naknakk left a comment

Choose a reason for hiding this comment

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

고생했습니당~ 점점 어려워지네요.. 서버에서 탈퇴한 회원이라는 정보를 주는 방식을 VC에서까지 알고 있어야 탈퇴한 회원임을 식별할 수 있는게 유지보수 측면에서 걱정이 됩니당 . .

서버가 주는 에러 방식에 (error를 던지거나.. 에러 없이 -1처럼 값을 던지거나..) 우리가 점점 휩쓸리는게 느껴지는 시점이네요. 나중에 userId == -1 이런 코드가 어떤걸 의미하는지 알기 어려워 질까봐 걱정이네요! 이렇게 -1을 던져주면 레포지토리를 통해서 entity단에서 error로 바꿔서 받는다던가..? 혹은 변수를 하나 추가해서 의미를 알기 쉽게 작성한다던가..? 뭔가 개선할 수 있으면 좋겠다고 생각이 듭니다. 완벽한 방법은 아직 모르겠네요.

나중에 이런 저런거 다같이 모아서 이야기 해봅시당

Copy link
Collaborator

@hyowon612 hyowon612 left a comment

Choose a reason for hiding this comment

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

고생했습니다!

@Guryss
Copy link
Member Author

Guryss commented Jan 9, 2025

고생했습니당~ 점점 어려워지네요.. 서버에서 탈퇴한 회원이라는 정보를 주는 방식을 VC에서까지 알고 있어야 탈퇴한 회원임을 식별할 수 있는게 유지보수 측면에서 걱정이 됩니당 . .

서버가 주는 에러 방식에 (error를 던지거나.. 에러 없이 -1처럼 값을 던지거나..) 우리가 점점 휩쓸리는게 느껴지는 시점이네요. 나중에 userId == -1 이런 코드가 어떤걸 의미하는지 알기 어려워 질까봐 걱정이네요! 이렇게 -1을 던져주면 레포지토리를 통해서 entity단에서 error로 바꿔서 받는다던가..? 혹은 변수를 하나 추가해서 의미를 알기 쉽게 작성한다던가..? 뭔가 개선할 수 있으면 좋겠다고 생각이 듭니다. 완벽한 방법은 아직 모르겠네요.

나중에 이런 저런거 다같이 모아서 이야기 해봅시당

좋아요! 사실 저도 코드 짜면서 이런 점이 아쉬웠던 것 같아요 ..
개선해보고는 싶지만 어떻게 시작을 해야할지, 어떤 방식을 적용해야할 지 잘 모르겠더라고요.
레퍼런스를 많이 찾아보면서 차근차근 개선해나가야 할 것 같아요! 말해줘서 감사합니당

@Guryss Guryss merged commit 530b0ba into main Jan 9, 2025
@Guryss Guryss deleted the Fix/#415 branch January 9, 2025 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Fix] 탈퇴한 유저 프로필 클릭 시 토스트 뜨도록 수정

5 participants