-
Notifications
You must be signed in to change notification settings - Fork 0
Feature(#243): 발표자 재접속 시 미해결 질문 & 화이트보드 정보 & 강의 시작시간 전달 #253
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
Feature(#243): 발표자 재접속 시 미해결 질문 & 화이트보드 정보 & 강의 시작시간 전달 #253
Conversation
발표자에게 질문 시 해당 질문 stream에 질문을 추가하고, 발표자가 해당 질문을 읽으면 ACK 요청을 보낸다. 혹여나 발표자 재접속 시 보류 리스트(pending list)의 질문을 전달한다.
if (roomInfo.presenterEmail !== email) { | ||
if (await isQuestionStreamExisted(data.roomId)) { | ||
await deleteQuestionStream(data.roomId); | ||
} | ||
await setQuestionStreamAndGroup(data.roomId); | ||
} | ||
if (roomInfo.presenterEmail === email) { | ||
await sendDataToReconnectPresenter(email, data.roomId, roomInfo); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 추가된 로직이 어떤 로직인가요? roomInfo.presenterEmail !== email
일때랑 roomInfo.presenterEmail === email
는 조건문 하나 if-else로 합칠 수 있을 것 같아요
const streamData = (await findQuestion(data.roomId, presenterEmail)) as StreamReadRaw; | ||
const question = getStreamKeyAndQuestionFromStream(streamData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문도 stream의 형태로 들어오나요??
const sendDataToReconnectPresenter = async (email: string, roomId: string, roomInfo: Record<string, string>) => { | ||
const unsolvedQuestions = (await findUnsolvedQuestions(roomId, email)) as StreamReadRaw; | ||
sendMessageUsingSocket('/create-room', email, 'reconnectPresenter', { | ||
whiteboard: roomInfo.currentWhiteboardData, | ||
startTime: roomInfo.startTime, | ||
questions: unsolvedQuestions[0][1] | ||
}); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 재접속한 사용자에게 현재 화이트보드 화면 정보를 알려주는 부분으로 이해했는데 맞을까요? 맞다면 재접속한 사용자와 처음 접속하는 사용자의 차이점? 같은게 있을까요?? 해당 로직들은 처음 들어온 사용자에게도 필요한 로직 같아서요!
const sendMessageUsingSocket = ( | ||
namespace: string, | ||
target: string, | ||
eventName: string, | ||
data: Record<string, string | Array<EntryRaw>> | ||
) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이벤트가 많아져서 관리하기 쉽지 않으셨을거 같은데 이렇게 뺀거 좋은거 같아요!
|
작업 개요
close #243
발표자 재접속 시 미해결 질문 & 최신 화이트보드 정보 & 강의 시작 시간을 전달한다.
작업 사항
고민한 점들(필수 X)
Redis를 사용하여 미디어 서버 역할 분리하기 문서의 기능 추가하기 챕터에 과정을 정리했습니다.
추가사항
재접속 한 발표자는 미디어 서버로부터 다음과 같은 메시지를 받습니다
위 "questions"는 아래와 같은 형태로 들어오게 됩니다.
ex) 4개의 질문이 들어온다면