Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

알림함에서 강의상세 진입 시 강의평 조회실패 수정 #390

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

plgafhd
Copy link
Collaborator

@plgafhd plgafhd commented Jan 27, 2025

@plgafhd plgafhd requested a review from a team as a code owner January 27, 2025 16:27
@@ -79,7 +79,7 @@ fun InstallInAppDeeplinkExecutor() {

homePageLectureDetailViewModel.initializeEditingLectureDetail(
lectureToShow,
ModeType.Viewing,
Copy link
Collaborator Author

@plgafhd plgafhd Jan 27, 2025

Choose a reason for hiding this comment

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

논의점이 되는 포인트는 여기 하나..! (뭔가 마우스 잘못 찍어서 안나오는데 ModeType.Viewing에서 ModeType.Normal로 바꿨어)
알림함에서 진입한 강의 상세를 ModeType.Normal로 열어도 되느냐 아니냐를 봐야할 것 같아
즉, 알림함에서 진입해서 바로 강의 편집이 가능한데, 이게 괜찮은건지 여부

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

일단 이렇게 한 이유부터...
에러가 났던 이유는 이 코드 때문

private suspend fun getLectureReview(): LectureReviewDto? {
    val originalLectureId =
        if (modeType.value == ModeType.Viewing) {
            editingLectureDetail.value.id
        } else {
            editingLectureDetail.value.lecture_id
        }
    return originalLectureId?.let { lectureId ->
        currentTableRepository.getLectureReviewSummary(lectureId)
    }
}

알림함에서 진입한 시점에서, ev에 GET 요청을 보내기 위해 필요한 강의의 id는 lecture_id인데, Viewing으로 열면 id를 보내게 됨
그래서 서버에서는 그런 강의는 없기 때문에 404를 응답으로 보내는 것

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

여기서 의문점이 하나 있었는데... 그럼 검색 결과에서 자세히를 눌러 강의 상세를 열 때는 왜 같은 문제가 생기지 않았는가?를 보면...

알림함 -> 강의 상세의 경우

  • 알림함에서 누른 그 강의에 대해, 사용자의 시간표에서 찾아서, 찾은 lecture를 쓰게 됨 그래서 여기에는 review 정보가 없고, 새로 위의 getLectureReview()를 호출해서 ev를 받아야 함

검색 결과 -> 자세히의 경우

  • 그냥 서버에서 준 lecture를 그대로 쓰게 됨 그래서 여기에는 review 정보가 있고, getLectureReview()를 아예 호출하지 않음

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

그리고 문제점 두가지...

backstack 처리

  • Viewing이면 그냥 뒤로가기 판정이 되는데 Normal이면 그렇지 않음... 그래서 backstack 관련 처리에서 한 것 처럼 처리가 필요했어

플로팅 버튼

  • 원래 알림함에서 열면 '해당 시간표로 이동' 이라는 플로팅 버튼이 떠다니는데, 만약 사용자가 강의 편집을 하고 싶다면 이 버튼이 좀 거슬릴 수 있음
  • 요거는 지금 고친 방법이 괜찮다!라는 결론이 나오면 고칠 예정

@JuTaK97
Copy link
Collaborator

JuTaK97 commented Jan 30, 2025

겁나게 복잡허네잉

@eastshine2741
Copy link
Collaborator

굿 이해했어
딥링크로 timetable_id, lecture_id 보니 원본 강의말고 시간표의 강의를 보여주는 게 의도된 거 같고
실제로 시간표의 강의를 갖고오는 로직도 DeeplinkExecutor에 있고

그렇다면 LectureDetailPage의 mode도 Normal(시간표의 강의)인 게 맞는듯??

기획상으로 맞는 건지 더블체크까지 되면
플로팅버튼은 새로 논의해서 풀어보자

Comment on lines 116 to 120
if (navController.currentDestination?.route == NavigationDestination.LectureDetail) {
navController.popBackStack()
} else if (navController.currentDestination?.route?.contains(NavigationDestination.TimetableLecture) == true) {
onCloseViewMode(scope) // 알림함에서 진입하는 경우 다시 알림함으로 돌아가야 함
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

navController.currentDestination?.route == NavigationDestination.LectureDetail 분기의 정체)
뒤로가기 연타하면 흰 화면 보이는? 버그를 막기 위한 코드
요 분기때문에 이 작업에서 TimetableLecture 분기도 추가되어 코드를 이해하기 어려워짐

-> 지금은 발생하지 않는 버그거나 발생하더라도 사소한 수준이라면
요 분기 없애고
Normal, Viewing 통일하고
onCloseViewMode를 항상 넣어줄 수 있도록 코드상에서 강제해본다

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