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

[AN] feat: 채팅 폴링 구현 #764

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

Conversation

gaeun5744
Copy link
Member

이슈

개발 사항

  • 최근 온 메시지를 ui 에 보여주는 기능 구현
  • 폴링 기법을 이용한 리스트 업데이트 구현

Copy link

Test Results

77 tests  ±0   77 ✅ ±0   1s ⏱️ ±0s
12 suites ±0    0 💤 ±0 
12 files   ±0    0 ❌ ±0 

Results for commit a2c2f41. ± Comparison against base commit fd16f90.

Comment on lines +10 to +11
val recentMessage: String?,
val recentMessageCreatedAt: LocalDateTime?,
Copy link
Member Author

Choose a reason for hiding this comment

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

채팅방 입실/퇴실일 경우 null이 들어옵니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@junjange junjange 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 +29 to +30
override fun onHiddenChanged(hidden: Boolean) {
super.onHiddenChanged(hidden)
Copy link
Member

Choose a reason for hiding this comment

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

해당 메서드는 어떤 역할을 하고, 로직도 설명해주면 좋을 것 같아요

Copy link
Member Author

Choose a reason for hiding this comment

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

불필요한 업데이트를 방지하고자, MainActivity에서 show를 할 때만 폴링을 진행하는 로직입니다!

_chats.value = room.chatRooms.map { it.toUiModel() }
memberId = room.myMemberId
}
delay(1000)
Copy link
Member

Choose a reason for hiding this comment

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

delay를 작성한 이유가 무엇일까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

폴링 주기를 생각했을 때, 1초가 너무 느리지 않은 적당한 업데이트 주기라고 판단했습니다.

@takoyakimchi
Copy link
Contributor

좋네요~!!

Copy link
Contributor

@jinuemong jinuemong 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 +10 to +11
val recentMessage: String?,
val recentMessageCreatedAt: LocalDateTime?,
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@dpcks0509 dpcks0509 left a comment

Choose a reason for hiding this comment

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

놀이터 폴링할때 나중에 참고하러 올게요 ~! 👍

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.

채팅 리스트 폴링 구현
5 participants